Microsoft said on Monday it would be willing to reopen talks to buy all or part of Yahoo , but only if a new Yahoo board is elected.

Microsoft said it would resume talks immediately if a new board were elected at Yahoo's August 1 stockholder meeting.

"..We confirm, however, that after the shareholder election Microsoft would be interested in discussing with a new board a major transaction with Yahoo!, such as either a transaction to purchase the "Search" function with large financial guarantees or, in the alternative, purchasing the whole company,"Microsoft said in a statement.

The Microsoft statement came after Icahn, a billionaire who owns more than 4 percent of Yahoo, issued an open letter saying he had "spoken frequently" to Microsoft CEO Steve Ballmer over the last week and asking new board of Yahoo to replace Yahoo's current CEO Jerry Yang.

In response, Yahoo issued a statement saying it continues to be willing to reopen talks with Microsoft, but "we feel strongly" that any deal negotiated between Icahn and Microsoft "would not lead to an outcome that would be in the best interests of Yahoo stockholders."

"Now Mr. Ballmer and Mr. Icahn have teamed up in an apparent effort to force Yahoo! into selling to Microsoft its Search business at a price to be determined in a future "negotiation" between Mr. Icahn's directors and Microsoft's management. We feel very strongly that this would not lead to an outcome that would be in the best interests of Yahoo!'s stockholders. If Microsoft and Mr. Ballmer really want to purchase Yahoo, we again invite them to make a proposal immediately. And if Mr. Icahn has an actual plan for Yahoo! beyond hoping that Microsoft might actually consummate a deal which they have repeatedly walked away from, we would be very interested in hearing it," Yahoo said.

Talks between Yahoo and Microsoft broke down in early May. Microsoft originally offered $31 per share and raised it to $33, but Yahoo demanded $37 per share.

After talks collapsed, Icahn amassed a stake in Yahoo and launched a proxy war to replace the Yahoo board and management.

Monday's turn of events amplifies the pressure on Yahoo co-founder and CEO Jerry Yang, whose handling of the earlier negotiations with Microsoft infuriated many shareholders.