Yahoo has cemented a deal with Google to run Google advertisements alongside Yahoo search results.

The move is a massive rebuff to Microsoft, which had been in talks with Yahoo until yesterday about acquiring all, or part of Yahoo.

Yahoo said it expects the deal to generate $250 million to $450 million (£125 million and £225 million) in operating cash flow during the first 12 months, and that it represents an annual revenue opportunity for Yahoo of $800 million (£400 million). The deal is for an initial period of four years, with an option for Yahoo to extend it for a further six years.

The deal was announced after Yahoo ended talks with Microsoft over a possible investment because the software giant was interested only in acquiring Yahoo's search business, not the entire company.

"Clearly it is time to move on," Yahoo CEO and co-founder Jerry Yang said during a conference call. "We believe this agreement with Google helps us to do so by strengthening our competitive position and generating attractive financial benefits."

Yang and Sue Decker, Yahoo's president, said the deal will allow Yahoo to capitalise on growth in the online advertising market and "the convergence of search and display advertising."

The deal applies to the US and Canada only and is non-exclusive, so Yahoo could cut deals with other companies and can also keep selling ads from its own Panama advertising platform.

Advertisers will pay Google for its ads that appear by Yahoo searches, and Google will then pay a portion of the revenue to Yahoo, Decker said. "We improve our access to the paid search universe, but on terms that work for us," she said.

Greg Sterling of Sterling Market Intelligence said, “While it’s no substitute for an outright acquisition from Microsoft in terms of shareholder value, this is probably smart for [Yahoo] provided they invest in their own platform.”

Continuing to develop Panama will be key to Yahoo’s future, Sterling said. “If they get lazy about it and start to turn over more and more to Google because they have the inventory and neglect their own platform, that could over time erode the position of Panama,” Sterling said. “So they have to be vigilant about that.”

As part of the deal, the companies also plan to make their instant-messaging services interoperate, Decker said.

Yahoo and Google had been in talks over a potential deal for months. It was seen as a way for Yahoo to strengthen its advertising business and alleviate the pressure to be acquired by Microsoft. Microsoft had cited any deal with Google as a potential deal-breaker in its talks with Yahoo. It had also called it a bad business decision that would only serve to strengthen Google, the online ad market leader.

Yahoo and Google said they don't require regulatory approval for the deal, but that they would delay its implementation for three-and-a-half months while the US Department of Justice reviews the arrangement. Various groups ranging from farmers to Microsoft have expressed concern about such a deal.

Related stories:

Yahoo denies 'poison pill' plan
Icahn attacks Yahoo chairman over pay