SAN FRANCISCO — Yahoo Inc. averted a showdown with rabble-rousing investor Carl Icahn on Monday by giving him three seats on its board of directors in a truce that still leaves the door open for a possible sale to Microsoft Corp.

The compromise spares Yahoo from more bickering with Icahn, an acerbic billionaire who had spent the past two months spearheading a rebellion to replace the Internet company's entire board in retaliation for its rejection of Microsoft's $47.5 billion takeover bid in May.

The duel had been scheduled to culminate in a shareholder vote at Yahoo's Aug. 1 annual meeting.

It now appears there will be fewer fireworks at that gathering, although some Yahoo shareholders are still expected to vent about the board's inability to get a deal done with Microsoft after six months of wrangling.

The main order of business will be the cease-fire giving Icahn three of the 11 seats on Yahoo's board, which will be expanded to make the deal possible.

Eight of Yahoo's current nine directors will be retained, leaving the company's current regime — headed by Chairman Roy Bostock and Chief Executive Jerry Yang — in the driver's seat.

Robert Kotick, the CEO of video game maker Activision Blizzard Inc. and a Yahoo director for five years, will surrender his seat as part of the agreement.

But the compromise, negotiated over the weekend, doesn't necessarily settle Yahoo's fate, which has been unclear since Microsoft made its first unsolicited offer in January.

Icahn, who owns a 5 percent stake in Yahoo, emphasized he still believes a sale of all or part of Yahoo may still be the best way for the company to lift its sagging stock price.

And with more than $1.5 billion invested in Yahoo, Icahn isn't likely to be satisfied with the status quo. He paid an average of about $25 per share for his Yahoo holdings, meaning he will sustain a loss unless the company's stock perks up.

Yahoo shares fell 78 cents Monday to finish at $21.67 — well below the $33 a share that Microsoft CEO Steve Ballmer dangled in early May before withdrawing the bid after Yang sought $37 per share.

Icahn's involvement on corporate boards hasn't always paid off. For instance, he won three board seats at Blockbuster Inc. in May 2005 and, since then, the movie rental chain's stock price has plunged by about 75 percent.

Microsoft didn't respond to requests for comment Monday, but has previously indicated it remains interested in exploring a deal with Yahoo, especially if the negotiations were handled by a new board.

Having been repeatedly rebuffed by Yahoo so far, Microsoft has been reported to be discussing a possible acquisition of Time Warner Inc.'s AOL. Microsoft wants to strengthen its Internet business to challenge Google Inc.'s dominance of the online search and advertising market.