The coffee shop to hotels group said earlier this year that it would split Costa and list it as a separate entity, following pressure from activist investor Elliott.
But on Friday the company said a sale of the business is now “in the best interests of shareholders”.
Proceeds of the deal will be used to pay down debt and boost the pension fund.
Whitbread added that it intends to return a significant majority of net cash proceeds to shareholders.
The Press Association reported in May that Whitbread had been approached informally over a potential buyout of Costa.
The company said the sale of the coffee chain will allow it to focus on its Premier Inn hotels business.
Chief executive Alison Brittain said: “This transaction is great news for shareholders as it recognises the strategic value we have developed in the Costa brand and its international growth potential, and accelerates the realisation of value for shareholders in cash.
“This combination will ensure new product development, continued growth in the UK and more rapid expansion overseas.”
Whitbread shares soared nearly 20% in early morning trade, catapulting it to the top of the FTSE 100.
Whitbread acquired Costa in 1995 for £19 million from founders Sergio and Bruno Costa when it had only 39 shops.
It now has more than 2,400 outlets and is embarking on overseas expansion.
Coca-Cola boss James Quincey said: “Costa gives Coca-Cola new capabilities and expertise in coffee, and our system can create opportunities to grow the Costa brand worldwide.
“Hot beverages is one of the few remaining segments of the total beverage landscape where Coca-Cola does not have a global brand.
“Costa gives us access to this market through a strong coffee platform.”
The deal comes hot the heels of another big money acquisition in the sector.
Pret A Manger was earlier this year sold by Bridgepoint for £1.5 billion to a company controlled by JAB, the investment vehicle of Germany’s wealthy Reimann family.
Neil Wilson, chief market analyst at markets.com, said: “The price looks like investors will get more bang for their buck than they would have done with a simple demerger.
“However, the growth story needs to be looked at because Whitbread has decided to change tack, shifting away from a demerger that it said would let the coffee and hotel chains grow more rapidly in favour of a quick sale.
“Clearly Coca-Cola sniffed an opportunity to gain an attractive brand with a fast-growing global presence. It’s a pretty good return too on the £19 million Whitbread paid for the coffee chain over 20 years ago.”