NEW YORK (CNNMoney.com) -- Microsoft Corp. announced Wednesday that it is investing $240 million for a minority 1.6 percent stake in Facebook, a price that values the social networking site at $15 billion.

Under the terms of the agreement, Microsoft will be the exclusive advertising platform for Facebook. Microsoft already had an agreement to sell ads in the U.S. and as part of the new deal will also now sell ads internationally.

"Making this investment and expanding this partnership will position Microsoft and Facebook to better take advantage of advertising opportunities around the world," said Kevin Johnson, president of the Platforms & Services Division at Microsoft, in a prepared statement.

The agreement comes after intense competition between Microsoft (Charts, Fortune 500) andGoogle (Charts, Fortune 500) for the stake in Facebook. Last year, Facebook rejected a $1 billion takeover offer from Yahoo Inc (Charts, Fortune 500).

Microsoft's money should be more than enough to pay for Facebook's ambitious expansion plans until the privately held company goes public.

Facebook founder, Mark 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.

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.

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 a meeting with analysts Wednesday at the company's Mountain View headquarters.

"We have tremendous respect for them," Armstrong said of Facebook.

Although News Corp.'s (Charts, Fortune 500) 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.

Also on Wednesday, BlackBerry maker Research in Motion Ltd (Charts). announced it has launched software that will make it easier for Facebook users to use the popular social networking site.

The site has already been available through the BlackBerry's Web browser, but the new software will allow BlackBerry users to automatically receive Facebook messages like they receive e-mail on the BlackBerry.

RIM said users will be able to wirelessly send and view Facebook photos, pokes and Wall posts.

T-Mobile USA will be the first carrier to provide the new application to its customers, as a free download. The carrier already provides a program that connects to a competing social network, MySpace, on some of its handsets.

From staff and wire reports.