Yahoo (YHOO) reported a 20.2% drop in its first-quarter earnings but beat Wall Street expectations, as the Internet giant’s efforts to attract advertisers begin to take hold.

The company also said revenue from Alibaba, the Chinese e-commerce giant, jumped 66% year-over-year in the December quarter, and net income was up 110%. Yahoo owns a stake of roughly 24% in Alibaba, which plans to go public in the U.S.

Yahoo shares rallied 7.9% to $36.90 in after-hours trading on Tuesday.

Sunnyvale, Calif.-based Yahoo booked a profit of $311.6 million, or 29 cents a share, from $390.3 million, or 35 cents a share, in the same period a year ago. Excluding one-time costs, adjusted earnings were flat at 38 cents.

Revenue slipped 1% to $1.13 billion. However, stripping out the commissions Yahoo pays its partners for web traffic, revenue was up 1% year-over-year after four consecutive periods in the red.

Analysts projected an adjusted profit of 37 cents a share and total revenue of $1.08 billion.

Under chief executive Marissa Mayer, Yahoo has aggressively expanded and updated its digital portfolio to generate more advertising revenue. Last year, Yahoo acquired blog site Tumblr for $1.1 billion, and more recently, the company has refreshed sites photo-sharing service Flickr.

In the first quarter, revenue generated by display ads remained at $453 million. The number of ads sold increased about 7%, while price-per-ad dropped 5%.

The latest period “was an early and important sign of growth in our core business,” Mayer said in a statement. “And, with mobile pivotal to our future growth, we’re delighted to now see more than 430 million monthly mobile users accessing Yahoo’s new products.”

Follow Matthew Rocco on Twitter @MatthewRocco