After weeks of speculation, Microsoft and Facebook made it official Wednesday afternoon. The software giant has taken an equity stake in the social networking powerhouse and, in return, gets to expand its exclusive advertising deal to handle ads for Facebook on a global basis.

But it didn't come cheap. In order to play, Microsoft is spending $240 million for roughly a 1.6 percent stake, based on an overall valuation of privately-held Facebook at $15 billion. Not bad for a company that was founded by three Harvard students in their dorm room in February 2004.

"It's a strong vote of confidence for our platform," Kevin Johnson, president of the Platforms & Services Division at Microsoft, said on a conference call for press and analysts Wednesday afternoon.

The two companies announced an advertising alliance in August 2006 that made Microsoft, with its fledgling adCenter ad serving engine, exclusive provider of banner advertising and sponsored links on the Facebook social network – but only in the U.S.

At that time Facebook said it had more than nine million registered users. (Earlier this year that alliance was extended to 2011.)

How times have changed in just a little more than a year.

The companies said in a joint statement Wednesday that Facebook currently has nearly 50 million active users and is adding some 200,000 new users per day. That's a lot of eyeballs, and Microsoft is definitely seeing green.

"If you believe they have the ability to reach 200 or 300 million users, you could very quickly get to that level of valuation," Johnson said of the size of Microsoft's investment.

The implication: It's money well spent.

"There's a lot more we're going to be doing together," Johnson added, though he declined to discuss any specifics.

Owen Van Natta, chief revenue officer at Facebook, said the cash will be at least partly used to hire more employees and to expand the company's technical infrastructure in order to handle the site's explosive growth. "We're doubling our user base every six months," he added.

Rumors had swirled of late that Google was also wooing Facebook, but Microsoft finally won out. In fact, Google signed its own exclusive advertising deal with social networking leader MySpace last year.

Google CEO Eric Schmidt, speaking at Google Analyst Day on Wednesday afternoon, did not comment specifically about the Microsoft and Facebook deal, but voiced strong interest in social networking sites in general as viable advertising markets.

"Social networks as a phenomena are very real [and] we want to be in a position [where] we can provide search and advertising services depending on where our competitive advantage resides," Schmidt said.

"We won't comment on Facebook," said Tim Armstrong, president of advertising and commerce for Google, North America. "We have tremendous respect for them and for the importance of social networking."

At least one veteran Microsoft watcher was upbeat about the Facebook deal.

"It's an investment now in hopes of earning far more back in the long run [and] to me, it's a good investment [because] Facebook has a lot of buzz, great user growth, and there's potential for the right company to monetize that user growth," Matt Rosoff, lead analyst for consumer products and corporate news at researcher Directions on Microsoft, told InternetNews.com in an e-mail.

Facebook's Van Natta echoed that sentiment during the conference call.

"We're focused on creating the best user experience that we can, and advertising is a part of that," he said.