The Internet company said it had net profit of $237 million, up from $213 million in the 2010 second quarter, slightly exceeding market expectations.
Excluding special items, earnings per share were 19 cents, a penny above the average analyst forecast.
Revenue, excluding commissions paid to partner websites, was $1.08 billion, a decline of 5.0 per cent year-on-year and worse than market expectations of a 2.0 per cent drop.
Yahoo! said in a statement the sales decline was mainly due to the revenue share related to its search agreement with Microsoft.
Microsoft and Yahoo! entered into a search and advertising partnership in 2009 which calls for Microsoft to eventually power searches at all Yahoo! websites.
Excluding that agreement and other special items, the Sunnyvale, California-based firm said, revenue minus commissions to partners for the second quarter increased 1.0 per cent from a year earlier.
Both net profit and revenue had fallen in the first quarter compared to the same period in 2010.
"We made clear progress in search, and saw strong growth in engagement on our media properties," Yahoo! chief executive Carol Bartz said in the statement.
"We experienced softness in display revenue in the second half of the quarter due to comprehensive changes we have made in our sales organization to position ourselves for more rapid display growth in the future."
Investors gave a thumbs-down to the second-quarter results. Shares were 2.40 per cent lower at $14.24 in after-market Nasdaq trade in New York.