The deal announced Wednesday after several weeks of negotiation values Palo Alto-based Facebook at $15 billion less than four years after Mark Zuckerberg started the online social networking site in his Harvard University dorm room.
Microsoft also will sell Internet ads for Facebook as the site expands outside the United States, broadening an existing marketing relationship that began last year.
Besides validating Zuckerberg's decision to rebuff a $1 billion takeover offer from Yahoo Inc. last year, Microsoft's money should be more than enough to pay for Facebook's ambitious expansion plans until the privately held company goes public.
Zuckerberg, 23, has indicated he would like to hold off on an initial public offering for at least two more years. In the meantime, Facebook hopes to become an advertising magnet by substantially increasing its current audience of nearly 50 million active users, who connect with friends on the site through messaging, photo-sharing and other tools.
The Facebook investment represents a coup for Microsoft because it provides the world's largest software maker with a toehold on one of the Internet's hottest platforms and a potentially lucrative forum for selling online ads.
Redmond, Wash.-based Microsoft has been trying to become a bigger force in Internet advertising for several years, only to watch Google deepen its dominance of the space.
In its fiscal year ending in June, Microsoft's online ad revenue rose 21 percent to $1.84 billion. Over the same period, Google's ad revenue totaled $13.3 billion.
With the Facebook investment, Microsoft dealt a rare setback to Google, which had previously trumped its bitter rival in earlier bidding battles involving AOL and Internet ad service DoubleClick Inc.
"Making this investment ... is a great win for not only for our two companies, but also our collective users and advertisers," Kevin Johnson, president of Microsoft's platforms and services division, said in a statement.
The coup shows Microsoft is getting more savvy about the Internet, said Matt Rosoff, an analyst for the research group Directions on Microsoft. "I think they understand it now and they're proceeding correctly. Two years ago, I would have said they don't get it at all."
Tim Armstrong, who oversees Google's North American advertising, declined to comment on the Facebook negotiations during s meeting held with analysts Wednesday at the company's Mountain View headquarters.
"We have tremendous respect for them," Armstrong said of Facebook.
Although News Corp.'s MySpace.com remains the largest social network, Facebook has been growing at a far more rapid clip during the past year. Facebook attracted 30.6 million U.S. visitors during September compared with 68.4 million at MySpace. Microsoft's social networking equivalent called "Windows Live Spaces" attracted an audience of 9.8 million, according to comScore Inc.