The acquisition is Facebook’s largest in its 10-year history.
The deal consists of $4bn in cash, $12bn of Facebook stock and $3bn of restricted stock that will be paid out to WhatsApp’s founders and their 50 employees over four years.
WhatsApp is a messaging app which has 450m monthly users, and claims 1m new registered users every day.
Mark Zuckerberg said in a statement: “WhatsApp is on a path to connect 1 billion people. The services that reach that milestone are all incredibly valuable.
“I’ve known Jan for a long time and I’m excited to partner with him and his team to make the world more open and connected.”
WhatsApp was created in 2009 by Ukrainian college dropout Jan Koum, and Stanford graduate Brian Acton.
Koum signed the deal in the welfare office in Mountain View, California, where he used to queue to get food stamps.
Facebook said that the messaging app will “continue to operate independently and retain its brand”.
CEO and co-founder Jan Koum, who will become a Facebook board member, said: “WhatsApp’s extremely high user engagement and rapid growth are driven by the simple, powerful and instantaneous messaging capabilities we provide.
“We’re excited and honored to partner with Mark and Facebook as we continue to bring our product to more people around the world.”
This is Facebook’s most significant acquisition, having bought Instagram for $1bn in 2012, and offering a rejected $3bn to buy Snapchat at the end of 2013.
Analysts say Facebook are interested in WhatsApp because of their huge growth amongst younger audiences, and in emerging markets.
WhatsApp is growing faster than Facebook, and 70% of those who have the app are active daily users.
In a call to analysts on Wednesday evening, Zuckerberg said: “it is the only app we’ve ever seen with higher engagement than Facebook itself”.
In addition to the growth the acquisition will provide, many also see the deal – like the Instagram acquisition – as a way of nullifying a threat to Facebook.