Starbucks Corp posted quarterly earnings on Tuesday that handily topped analysts' estimates as the world's biggest coffee chain began reaping rewards from slashing costs and closing stores, sending its shares up 9 percent.

Net income for its fiscal third-quarter ended June 28 was $151.5 million, or 20 cents per share. A year earlier, Starbucks reported a net loss of $6.7 million, or 1 cent per share -- its first quarterly net loss as a public company.

Excluding restructuring charges, Starbucks earned 24 cents a share in the latest quarter.

Analysts, on average, had been looking for a profit before items of 19 cents per share, according to Reuters Estimates.

Total revenue fell to $2.4 billion from $2.6 billion.

Starbucks global same-store sales fell 5 percent, after sales at established U.S. restaurants declined 6 percent.

The chain, which faces increasing competition in coffee from the likes of global fast-food giant McDonald's Corp , has cut jobs, attacked expenses and targeted more than 1,000 stores around the world for closure. It also has selectively lowered prices to attract and retain consumers in a lingering recession.

The shares finished down 1.5 percent at $14.69 on the Nasdaq in the regular trading session but jumped to $16 in extended trade.

(Reporting by Lisa Baertlein; Editing Bernard Orr)