Mazda Motor Corp. will build compact cars for Toyota Motor Corp. at its new factory in Mexico in an apparent bid to further expand its overseas operations with Toyota's help, after losing the backing of Ford Motor Co. of the United States.

The two companies made an announcement about their first ever move for cooperation in production on Friday.

Having staked its future on its push overseas, the Mexican assembly lines are believed to be critical for Mazda in generating stable earnings. The tie-up with Toyota will enable Mazda to learn from its bigger rival in technology and management.

Mazda had for over 30 years relied heavily on its cooperation with Ford. But Ford has gradually pulled out of Mazda management after it faced a business dilemma in the wake of the 2008 financial crisis. Ford has since directed its resources to North America and growing emerging markets instead.

Mazda was left with a manufacturing system not designed to withstand a strong yen, and weakened financial credibility in the absence of Ford's backing.

Earlier this year, Mazda raised around 140 billion yen ($1.75 billion) through equity issues, a move that helped strengthen its balance sheet and build a plant in Guanajuato, Mexico. Mazda proceeded with the Mexican project with its back against the wall and cooperation from Toyota.

For Toyota, the deal with Mazda will help expand its compact car lineup that is well accepted by consumers, though it has already established a strong presence in the North American market.

Toyota already has a factory in Mexico, which is building the Tacoma pickup truck chiefly for North America. Toyota apparently judged that it can reduce its financial burden by relying on Mazda.

Toyota, which already sells more cars in North America than in Japan, appears to be hoping another compact model based on a Mazda car would help expand its customer base.