Facebook will spend 1 billion dollars (£629 million) to buy the photo-sharing software company Instagram.
The deal comes days after the service began offering a version for Android phones. The payment will be in cash and Facebook stock.
Facebook is expected to complete its initial public offering of stock next month.
It is Facebook's largest acquisition to date.
Instagram lets people apply filters to photos they take with their mobile devices. Some make the photos look as if they were taken in the 1970s or on Polaroid cameras.
Facebook says it will keep Instagram running independently. Users will be able to run it on rival social networks such as Twitter - a departure from Facebook's tendency to buy small start-ups and integrate the technology - or shut it down.
The deal is expected to close by the end of June.
"This is an important milestone for Facebook because it's the first time we've ever acquired a product and company with so many users," CEO Mark Zuckerberg wrote on his Facebook page. "We don't plan on doing many more of these, if any at all.
"We think the fact that Instagram is connected to other services beyond Facebook is an important part of the experience," Mr Zuckerberg wrote. "We plan on keeping features like the ability to post to other social networks, the ability to not share your Instagrams on Facebook if you want, and the ability to have followers and follow people separately from your friends on Facebook."
Facebook is hiring San Francisco-based Instagram's roughly 10 employees. The deal is expected to close by the end of June.
Getting Instagram is big win for Facebook as it works to harness people's growing obsession with their mobile devices and sharing every moment of their life.
Instagram was only available Apple devices until recently. An app for Android devices was released last week.