Rebuffing aggressive overtures from Microsoft, Time Warner has agreed to sell a 5 percent stake in America Online to Google for $1 billion as part of an expanded partnership between AOL, once the dominant company on the Internet, and Google, the current online king.

While the deal terms are largely set, it will not be final until it is ratified by the Time Warner board on Tuesday, according to an executive who was briefed on the negotiations.

The executive said negotiations between the three companies reached a fevered pitch on Thursday night when teams from Google and Microsoft were in separate rooms of the Time Warner Center in Manhattan and executives from the media company walked back and forth between them.

Finally, around 9 p.m., Richard D. Parsons, chief executive of Time Warner told Eric E. Schmidt, chief executive of Google, that he would accept Google's recently sweetened offer. Google, which prides itself on the purity of its search results, agreed to give favored placement to content from AOL throughout its site, something it has never done before.