Microsoft Corp. abandoned its three-month-old bid to buy internet firm Yahoo on Saturday, after the two sides failed to agree on an acceptable sale price.

Microsoft chief executive Steve Ballmer formally withdrew the offer in a letter to Yahoo chief executive Jerry Yang.

The software giant said it was willing to raise its offer to $47.5 billion or $33 a share for Yahoo, but Yahoo demanded at least $4 more per share, pushing the price up to $53 billion.

Despite our best efforts, including raising our bid by roughly $5 billion, Yahoo has not moved toward accepting our offer, Mr. Ballmer said in a Microsoft press release.

After careful consideration, we believe the economics demanded by Yahoo do not make sense for us, and it is in the best interests of Microsoft stockholders, employees and other stakeholders to withdraw our proposal, he added.

Mr. Ballmer also said it would not make sense for Microsoft to pursue a lengthy proxy fight. Our discussions with you have led us to conclude that, in the interim, you would take steps that would make Yahoo undesirable as an acquisition for Microsoft, he wrote.

Yahoo rejected Microsoft's offer repeatedly, saying it undervalued the company. Microsoft at times threatened to lower its offer, originally valued at $44.6 billion, or $31 a share.

The software giant had wanted to do a deal to boost competition against Google Inc., who is currently the leader in the $41 billion online advertising market.

When Microsoft first announced its takeover offer in February it said together Microsoft and Yahoo can offer a competitive choice while better fulfilling the needs of customers and partners.

Microsoft's shares closed on Friday virtually unchanged at $29.24. Yahoo's shares were $1.85 higher at $28.67 amid expectations of a higher Microsoft offer.