Alcoa Inc posted a surprise profit on Wednesday, after three consecutive quarterly losses, mainly because of cost savings and an increase in aluminum prices.

Third-quarter net earnings were $77 million, or 8 cents per share, compared with earnings of $268 million, or 33 cents per share in the same quarter of 2008, the Pittsburgh-based aluminum producer said.

Excluding restructuring and one-time items, the profit was $39 million, or 4 cents per share -- smashing analysts' average forecast of a loss of 9 cents per share, according to Thomson Reuters I/B/E/S.

Revenue fell to $4.6 billion from $7.00 billion a year earlier, but was 9 percent higher than the second quarter and higher than analysts' average estimate of $4.55 billion, according to Thomson Reuters I/B/E/S.

The economic downturn since September 2008 has affected most of Alcoa's end markets -- automotive, commercial transportation, building and construction, and aerospace.

But in July, Chief Executive Officer Klaus Kleinfeld said there were signs that weak aluminum demand -- which has prompted production cuts and plummeting metals prices in the last year -- might be easing.

During the third quarter, the price of aluminum rose 16 percent to $1,890 per metric ton.

(Reporting by Steve James; Editing by Gary Hill)