Struggling flag carrier Malaysia Airlines said Thursday it recorded its best quarterly result for two years as it continued to push forward with a cost-cutting campaign.

The airline, which a year ago admitted it was in "crisis", recorded a second consecutive quarterly net profit, earning RM51 million ($16.5 million) for the last three months of 2012.

This left it with a RM433 million net loss for the 2012 financial year, a huge improvement from a record RM2.5 billion loss the previous year.

"The massive swing from a RM1.3 billion loss in the fourth quarter of 2011 to a profit of RM51 million ... shows that our business plan is working," chief executive Ahmad Jauhari Yahya said in a statement.

"We continue to gain traction in multiple initiatives that focus on increasing revenue and managing costs. The fourth quarter of 2012 is really a milestone for our team."

The airline has battled for years to stay in the black, with analysts blaming a combination of stiff competition, poor management, change-resistant unions, government interference and other factors.

In June last year Malaysia Airlines pushed back a planned 2013 return to profitability after a tie-up with rival budget carrier AirAsia crumbled due to resistance from its own employees.

Analysts had predicted the venture would help the flag carrier by eliminating head-to-head competition on some routes.

Amid the gloom, the airline embarked on a cost-cutting campaign centred on slashing routes, including those to Rome, Johannesburg, Cape Town, Buenos Aires, Karachi and Dubai.

It said the move was a key factor in slashing expenses by RM1.8 billion over the 2012 financial year.

But Ahmad Jauhari added that the industry "continues to be very dynamic and challenging" and more work was needed to deliver sustained profits.

The company also said its ongoing fleet renewal, with deliveries of new fuel-efficient aircraft scheduled until 2017, "becomes even more significant" as fuel prices remain high.