Zynga has reported a sharp drop in its losses in the last three months of 2012, as revenues at the designer of games including Farmville stabilised.
It lost just $48.6m (£30.8m), down from $435m for the same period a year ago.
Revenues were largely unchanged at $311m, suggesting that the exodus of online gamers that plagued the firm last year may have eased off.
The results were well ahead of market expectations, and the company's share price gained 6% in after-hours trading.
Excluding one-time costs, the firm made a profit of one cent per share, comfortably beating expectations for a three-cent loss.
Its shares ended Tuesday trading on the Nasdaq stock exchange at $2.75, down from a peak of almost $15 in March last year.
The San Francisco-based company has been undergoing a transformation, breaking its ties with Facebook, which previously hosted its games, and setting up its own gaming platform.
Zynga is also applying for a gaming licence in Nevada, home of Las Vegas, in order to offer players a new suite of casino-style games on which they can bet real money, in conjunction with the online gambling firm Bwin.Party.
It comes after a tough year in which user numbers steadily fell as players switched from their mainly Facebook-based games to the more smartphone-friendly apps produced by rival firms.
The firm largely severed its close ties with Facebook last December, depriving the games developer of its privileged access to the social network's one billion users, but also freeing it from the obligation to carry Facebook adverts.
About 80% of Zynga's revenues were thought to come through Facebook last year.