NEW YORK -- Yahoo said Tuesday that its second-quarter earnings and revenue declined, as the company struggled again with display advertising sales.

Its stock, however, increased as Yahoo also announced that Alibaba Group agreed to reduce the number of shares Yahoo is required to sell in the Chinese Internet company in an initial public offering of stock this year. Yahoo, which holds a 24 percent stake in Alibaba, now has to sell only 140 million shares in the IPO, down from 208 million earlier.

Although the reduction means that Yahoo's immediate windfall from the Alibaba IPO will be smaller, it's also a long-term bet on Alibaba's success. Analysts say Alibaba's IPO could be bigger than Facebook's $16 billion stock debut two years ago, which would make Alibaba the biggest tech IPO ever.

Yahoo earned $270 million, or 26 cents per share, in the March-June quarter. That's down from $331 million, or 30 cents per share, in the same period a year earlier. Adjusted earnings were 37 cents per share in the latest quarter.

Revenue fell 4 percent to $1.08 billion from $1.14 billion. After subtracting commissions paid to Yahoo's ad partners, revenue totaled $1.04 million, down 3 percent from $1.07 billion a year ago.

Analysts were expecting adjusted earnings of 39 cents per share and post-commission revenue totaling $1.09 billion, according to Zacks Investment Research.

CEO Marissa Mayer said the company was "not satisfied" by the results.

"(We) saw display revenue decline, further highlighting the fact that we need to work faster to ameliorate the negative trends," she said in a statement. "I believe we can and will do better moving forward."

The Alibaba deal overshadowed Yahoo's lackluster results. Shares of Sunnyvale-based Yahoo rose 34 cents to $35.95 in extended trading. The stock had closed at $35.61, down 9 cents for the day and nearly 12 percent since the start of the year. By comparison, the Standard & Poor's 500 index is up 7 percent this year.