Facebook will sell a $240m (£120m) minority stake to Microsoft, as part of a deal which will also expand the advertising services it provides to the social networking site.
The ownership stake Microsoft will take during Facebook's next round of financing puts the site at $15bn (£7.5bn).
The deal with Microsoft shuts out Google, which had been reported to be courting Facebook.
In addition to the shareholding, Microsoft will also extend its existing agreement to provide banner ads to Facebook in the US. With this deal, Microsoft will become Facebook's exclusive third-party ad platform, as well as provide Facebook ads internationally.
"This is about placing a big bet on the future of Facebook and positioning Microsoft possibly for an outright acquisition later, as well as keeping Facebook away from Google," said analyst Greg Sterling from Sterling Market Intelligence.
During a conference call after the announcement, Owen Van Natta, Facebook's vice president of operations and Chief Revenue Officer, didn't acknowledge Google was one of the company's suitors.
He said Facebook chose Microsoft because of its reputation as one of the world's top technology providers. "We were fortunate to have a lot of folks who wanted to partner with us around advertising," he said.
Kevin Johnson, president of Microsoft's Platforms and Services Division, called the deal a "big vote of confidence" for Microsoft's advertising strategy.
However, he said advertising is just one area of convergence for the companies, though he declined to mention specifically in what other areas of technology or business the two companies will collaborate.
Facebook is likely use the cash from its next financing round to pay for a rapid headcount and platform expansion to cope with expected growth in user numbers.in the coming 12 months in usage and headcount.
With 300 employees currently, Facebook expects to have about 700 staff a year from now, its CEO and co-founder Mark Zuckerberg said last week at the Web 2.0 Summit.