Whitbread chief executive Alison Brittain said the company would now focus on its Premier Inn business in the UK and Germany.
Whitbread bought Costa, which is now the UK’s biggest coffee chain, for just £19m in 1995.
At the time, it had just 39 outlets. It now has more than 2,400 UK coffee shops, as well as some 1,400 outlets in 31 overseas markets. Costa Express has 8,237 vending machines worldwide.
Ms 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.
“The announcement today represents a substantial premium to the value that would have been created through the demerger of the business and we expect to return a significant majority of net proceeds to shareholders.
“Whitbread will also reduce debt and make a contribution to its pension fund, which will provide additional headroom for the expansion of Premier Inn.”
Whitbread announced earlier this year that it was planning to spin off Costa.
The deal is subject to the agreement of Whitbread’s shareholders and various other approvals, including from anti-trust bodies.
It is expected to complete in the first half of next year.