(Fortune) -- After months of negotiations with Microsoft, Yahoo has ditched the software giant for Google.

Yahoo (YHOO, Fortune 500) struck an online advertising partnership with Google (GOOG, Fortune 500) late Thursday that it believes is a better deal than hooking up with Microsoft (MSFT, Fortune 500). Yahoo chief executive Jerry Yang said the search advertising tieup could bring the company an extra $800 million in annual revenues.

Investors disagreed. Yahoo's stock tanked by 10% Thursday when news hit that a deal between Microsoft and Yahoo would definitely not happen. Yahoo's shares did not rise on the announcement of the Google agreement in after-hours trading.

"Clearly it is time to move on," Yang told investors in a conference call Thursday. Yang said that Microsoft executives told Yahoo's board on June 8 that they weren't interested in a full acquisition and that it was only interested in buying Yahoo's search business.

Yahoo saw a non-exclusive arrangement with Google to be more beneficial than a partial one with Microsoft. Yahoo says it will mix and match Google's paid search ads alongside its own search results within North America and offer Google's text-based ads on its web properties.Yang said Yahoo will continue to use Panama, its own search technology.

"This will put Yahoo on a faster track in the global online advertising market," he said.

The company expects to generate between $250 to $450 million in operating cash flow once the deal gets the blessing of the Justice Department, which could take up to 3-1/2 months. The deal is expected to run up to ten years.

Google gets the dual benefit of gaining a major publisher in Yahoo and keeping the Internet portal out of the hands of Microsoft. Google CEO Eric Schmidt said the deal would benefit users and advertisers because Google will be able to place higher-quality ads now that it will gain access to Yahoo's network. "This is an important partner deal for us," Schmidt said in a conference call late Thursday afternoon.

Microsoft CEO Steve Ballmer has previously stated that the company would not be interested in pursuing Yahoo if Yahoo decided to partner with Google. Yet shortly after Yahoo announced that talks with Microsoft were over, the company released a statement that the deal wasn't over yet and that "our alternative transaction remains available for discussion."

Some shareholders said Thursday that they remained confident Microsoft would return with an offer. "I don't think things are over between Microsoft and Yahoo," said Chris Boova, an investment officer for tech stocks at J. & W. Seligman, which has a minor stake in Yahoo. "I remain of the opinion that the greatest value that can be realized from Yahoo is a deal with Microsoft."

Added Ryan Jacob of the Jacob Internet Fund, which also has small stake in Yahoo, "This isn't completely over. The board meeting is coming up. And shareholders will still have their say."

Yahoo's move to partner with Google was seen as a way to appease disgruntled shareholders who favored a sale to Microsoft. Investors will have a chance to vote for Yahoo's board members or support billionaire activist Carl Icahn, who is leading a charge to kick out Yang as CEO and implement his slate of nominees as directors.

Boova says he is undecided whether he will vote for Icahn or Yahoo's existing board. His institutional fund has roughly the same number of shares as Icahn Associates. "I'm somewhat frustrated with the level of unwillingness [by Yahoo's board] to conclude a transaction," he said. "We haven't reached a decision yet on how we'll vote."