Yahoo said Tuesday swung to a loss in the second quarter but that revenues grew as the Internet pioneer refocused its efforts on mobile and other growing sectors.

The loss of $22 million compared with a profit of $270 million in the same period a year ago.

But chief executive Marissa Mayer said she was pleased with the revenue growth, saying, "Yahoo's transformation continues to make great progress."

Total revenues jumped nearly 15 percent to $1.24 billion, led by what Mayer has dubbed the new emerging areas for Yahoo of "Mavens," or mobile, video, native and social.

"Our Mavens investment businesses across mobile, video, native and social grew to nearly $400 million in this quarter, delivering 60 percent... growth year-over-year," she said in a statement.

Yahoo has been struggling in recent years since losing its lead in Internet search to Google, and has been aiming for new niches under Mayer's leadership.

A key asset for Yahoo is its stake in Chinese online giant Alibaba. That stake is to be spun off into a separate company later this year.

Yahoo is awaiting a ruling by the US Internal Revenue Service about what portion of the transaction will be tax-free.

Yahoo has warned in the filing that there could be tax implications.