This translated into net earnings of $99m, a sharp increase from Q1 2016 when it reported a net loss of $99m.
In a statement, Marissa Mayer, chief executive of Yahoo, said: "These results are the product of our teams' tremendous focus and dedication to our users and advertisers.
"As we enter our final quarter as an independent company, we are committed to finishing strong and planning for the best possible integration with Verizon. With the transaction anticipated to complete in June.
"I've never been more proud of the improvements we've made to the business and the value we've delivered to our shareholders."
Mayer also added that the sale of Yahoo's £3.8bn sale of its core business to Verizon was on track to be completed in June. The deal was delayed earlier this year due to a breach of Yahoo's data.
The company reported a strong increase in its mobile, native, video and social businesses (which Yahoo calls MaVeNS) to $529m from $390m in Q1 2016.
Its revenue from mobile alone was $412m, up from $260m in the first quarter last year, representing an increase of 32%.
Desktop revenue still represents a strong source of income for Yahoo at $859m in revenue, up from $774m in the first quarter of 2016.
Search revenue was $745m in the first quarter of 2017 compared with $492m for the first quarter of 2016.
One area that registered a drop was display revenue which fell 2% to $456m.