Fighting off Microsoft cost Yahoo $22 million (£11 million) and dented the company's net income for the second quarter, the internet company revealed.
Operating income for the second quarter of 2008 was $101 million (£50.7 million), a 45 per cent decrease compared to last year after the company spent $22 million on outside advisers and legal costs related to Microsoft's attempt to buy Yahoo.
Profits slipped to $131 million (£65.75 million), compared to $161 million (£80.8 million) for the same period of 2007.
Jerry Yang, co-founder and chief executive of Yahoo, said: "Yahoo saw benefits in the second quarter from a number of the strategic initiatives that we have been delivering against, including the roll out of innovations in search and the announcement of a number of important partnerships.
"We are seeing validation that we have the right strategy as we continue to make transformational investments that position us to take advantage of pivotal trends driving growth on the internet."
During the extended battle, Yahoo maintained that Microsoft's $47.5 billion (£23.84 billion) offer undervalued the company and eventually the software giant retreated, with Yahoo striking an advertising deal with Google instead.
Yahoo president, Sue Decker, said: "Our commercial agreement with Google is another great example of our open strategy and we expect it will strengthen our competitive position as a leading provider of search and display advertising.
"We remain confident that our efforts will lead to a stronger and more profitable Yahoo."
Not only did the company have to handle Microsoft's hostile takeover bid this quarter, Yahoo also faced a challenge to have its entire board replaced by investor Carl Icahn and his team.
Although Mr Icahn did not succeed in replacing all the board members, he did manage to get himself elected.
Yahoo maintained its outlook for the rest of the year, forecasting revenues to be within the range of $7.35-$7.85 billion (£3.7-£3.9 billion).