Japan's Mazda has returned to profitability.

Fending for itself against increasingly large and consolidated rivals hasn't proven easy for Mazda, but the zoom-zoom automaker announced last week that it returned to profitability during the second fiscal quarter of 2012.

The automaker posted a $153 million (12.2 billion yen) net profit for the three months ending September 20, a major turnaround from a roughly $178 million loss during the same period last year.

Mazda's net profit was significantly ahead of the 9.62 billion yen analyst estimate compiled by Thomson Reuters.

Mazda's fiscal year ends in March. It estimates a 10 billion yen for the current fiscal year ending in March of 2013.

Still, the automaker warned that continued economic woes in Europe remain a major hurdle. In addition, the automaker continues to face difficulties by its relatively high cost of production since the automaker exports nearly 80 percent of its vehicles built in Japan, where a strong yen stifles its profitability.

A new plant opened in Russia earlier this year to supply that market, which is one of Mazda's strongest. But lucrative North American has become an export-only market now that the company pulled out of a joint-venture with Ford in Michigan. A new Mazda plant is set to open in Mexico in about 18 months.