The agreement also provides for an additional $3 billion in restricted stock, to be granted to WhatsApp's founders and employees, that will vest over four years once the deal closes.

Facebook has agreed to acquire messaging service WhatsApp for approximately $16 billion, including $4 billion in cash and about $12 billion worth of Facebook shares, Facebook said in a release.

WhatsApp has more than 450 million users a month and nearly 1 million sign-ups daily, according to Facebook.

"Our mission is to make the world more open and connected," Facebook CEO Mark Zuckerberg said in a post. "We do this by building services that help people share any type of content with any group of people they want. WhatsApp will help us do this by continuing to develop a service that people around the world love to use every day."

(Watch: Twitter has work to do: Analyst)

Facebook said it would keep WhatsApp as a separate service, just as it did with Instagram, which it bought for about $715.3 million.



The social media giant also said WhatsApp co-founder and CEO Jan Koum would join Facebook's board.

News of the deal sparked in rally in BlackBerry shares in extended hours on speculation of higher valuation for the company. The stock rose 6 percent in after-hours.

BlackBerry has declined to comment.

—CNBC.com with wires