Facebook Inc. agreed to buy messaging company WhatsApp for $19 billion in cash and stock, a blockbuster transaction that dwarfs the already sky-high prices that other startups have been able to recently command.

The 55-employee company, which acts as a kind of replacement for text messaging, has seen its use more than double in the past nine months to 450 million monthly users. That makes its service more popular than Twitter Inc., the widely used microblogging service which has about 240 million users and is currently valued at about $30 billion.

The transaction, which includes $3 billion in restricted stock units to be granted to WhatsApp's founders and employees over four years, ranks as the largest-ever purchase of a company backed by venture capital.

Besides making its founders billionaires, the deal marks an enormous windfall for Sequoia Capital, the only venture firm that backed WhatsApp. Sequoia invested about $60 million for a stake valued at up to $3 billion in the deal, according to a person familiar with the matter.

The deal price also easily outranks any acquisition of startups in recent years, including Facebook's purchase of photo-sharing app Instagram for more than $1 billion in 2012, and, a year earlier, Microsoft Corp.'s $8.5 billion buy of video-calling company Skype.