Microsoft's Ashley Highfield: "It brings scale and innovation to the search market"
Yahoo and Microsoft have announced a long-rumoured internet search deal that will help the two companies take on chief rival Google.
Microsoft's Bing search engine will power the Yahoo website and Yahoo will in turn become the advertising sales team for Microsoft's online offering.
Yahoo has been struggling to make profits in recent years.
But last year it rebuffed several takeover bids from Microsoft in an attempt to go it alone.
Yahoo shares closed down 12.1% on the day, while Microsoft shares moved up by 1.4%.
Microsoft boss Steve Ballmer said the 10-year deal would provide Microsoft's Bing search engine with the necessary scale to compete.
"Through this agreement with Yahoo, we will create more innovation in search, better value for advertisers, and real consumer choice in a market currently dominated by a single company," said Mr Ballmer.
"Microsoft and Yahoo know there's so much more that search could be. This agreement gives us the scale and resources to create the future of search," he added.
Yahoo is bowing to the inevitable. It simply had neither the resources nor the focus to win the technological arms race for search supremacy
In return for ceding control of its search engine, Yahoo will get to keep 88% of the revenue from all search ad sales on its site for the first five years of the deal, and have the right to sell adverts on some Microsoft sites.
Yahoo's search team, meanwhile, will have to brace itself for job losses over the next two years. Some staff will transfer to Microsoft, others can stay on with Yahoo, but redundancies would be unavoidable, Yahoo chief executive Carol Bartz told the BBC.
Yahoo said the deal would benefit Yahoo's users and advertisers.
"This agreement comes with boatloads of value for Yahoo, our users, and the industry. And I believe it establishes the foundation for a new era of internet innovation and development," said Ms Bartz.
January 2008: Microsoft offers to buy Yahoo for $44.6bn in cash and shares, later raised to $47.5bn
May 2008: Microsoft walks away from the table after the two sides fail to agree on a price
June 2008: Yahoo strikes a deal to use Google's technology, with Google ads appearing on some Yahoo search results
November 2008: Google abandons the Yahoo deal after objections from anti-trust regulators in the US
November 2008: Yahoo co-founder Jerry Yang stands down as the firm's boss
April 2009: Yahoo says it will cut 5% of its workforce after quarterly profits drop sharply
May 2009: Microsoft relaunches its own search engine, now branded bing.com
July 2009: After new speculation, Microsoft and Yahoo finally announce a web search deal
The deal became possible after Yahoo's co-founder Jerry Yang stepped down as chief executive of the company late last year.
"Only a Yahoo outsider like Ms Bartz could do such a deal," said Tim Weber, business editor of the BBC News website.
"She has no sentimental attachment to what was once the core of Yahoo, its search business. Microsoft was helped by the fact that at long last it managed to develop a search engine - Bing - that is a credible alternative to search giant Google."
Technology analyst Rob Enderle said: "This move makes up for a lot of the stupid mistakes made by the preceding [Yahoo] administration".
Yahoo said the deal would boost annual operating income by $500m and secure $200m in savings.
The tie-up will give Microsoft and Yahoo a combined market share in the US search ad market of about 30%.
Google would still be the dominant force with a share of about 65%.
The deal ends years of back-and-forth negotiations between the two companies.
Microsoft originally offered to buy Yahoo in January 2008 - with an offer worth about $47.5bn.
But Mr Ballmer later withdrew that bid after Yahoo's then boss, Mr Yang, demanded a higher price.
Yahoo instead opted for an online advertising partnership with rival Google.
But that tie-up was later abandoned because of the risk of a protracted battle with regulators over competition issues.
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.