SAN FRANCISCO — Yahoo Inc. is relinquishing three seats on its board of directors to activist investor Carl Icahn, ending a battle for control of the Internet company while still leaving the door open for a possible sale to Microsoft Corp.

The truce announced Monday gives Yahoo a reprieve from two months of bickering with Icahn, who had been spearheading a shareholder rebellion aimed at replacing the company's entire board in retaliation for its rejection of Microsoft's $47.5 billion takeover bid in early May.

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

But the compromise 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 Sunnyvale, Calif.-based company to lift its sagging stock price. Yahoo's current board already has said it remains open to reviving sales negotiations with Microsoft after repeatedly rejecting a series of proposals from the Redmond, Wash.-based software maker.

Microsoft didn't immediately respond to a request for comment Monday.

Yahoo's expanded board may include a possible successor to Yahoo Chief Executive Jerry Yang, whom Icahn had threatened to fire if his attempted coup had been successful.

Besides taking a board seat himself, Icahn will be able to recommend two other directors.

To fill those spots, Icahn will choose from the eight men he had already nominated and one new candidate — Jonathan Miller, the former CEO of Yahoo rival AOL. Miller is the kind of seasoned CEO that Icahn envisioned for Yahoo.

Eight of Yahoo's nine current directors, including Yang, will fill the remaining seats. Robert Kotick, a Yahoo director for the past five years, will surrender his seat as part of the agreement with Icahn.

Even with the cease-fire, there could be lingering tensions on Yahoo's board because of the recent theatrics involving Icahn.

Microsoft teamed up with Icahn to make its most recent offer to buy Yahoo's online search operations just 10 days ago. After Yahoo angrily shunned the complicated proposal, Yang and Chairman Roy Bostock engaged in a caustic exchange with Icahn, who argued the company had made "another grave mistake" in its rebuff.

In his own statement, Yang said he looked forward to working with the new board members to "help us take advantage of the large and growing opportunity ahead of us."

Yahoo shares fell nearly 2 percent to $22.02 in premarket trading from a $22.45 close Friday. Microsoft shares rose 14 cents to $26 from a $25.86 close Friday.