LONDON (Reuters) - Coca-Cola Co KO.N has agreed to buy coffee chain Costa for $5.1 billion to extend its push into healthier drinks and take on the likes of Starbucks and Nestle in the booming global coffee market.

The purchase from Britain's Whitbread WTB.L of Costa's almost 4,000 outlets thrusts the world's biggest soda company into one of the few bright spots in the sluggish packaged food and drinks sector.

Paying about 1 billion pounds ($1.3 billion) more than some analysts had expected, Coke will use its distribution network to supercharge Costa's expansion as it chases coffee chain market leader Starbucks SBUX.O and its almost 29,000 stores across 77 markets.

Beyond coffee shops, Coca-Cola CEO James Quincey, a Briton familiar with the UK brand, said Costa would provide an important growth platform ranging from beans to bottled drinks in an attractive category, growing by around 6 percent a year.

Coke already sells some coffee, such as the Georgia brand in Japan, but lacks a global offering, Quincey said in a blog post here, highlighting Costa's retail footprint, roastery, supply chain and Costa Express vending system, which the company plans to expand.

“Coffee is one of the strongest growing categories in the world, and Coca-Cola needs to expand into coffee and hot drinks,” he said.

Operating a retail chain marks a new challenge for 132-year-old Atlanta-based Coca-Cola, which mostly sells soft drink concentrates to a network of franchised bottlers.

It will face a fight, as rivals are also bulking up in a fragmented market, keen to attract young people prepared to pay out for barista-made drinks and developing tastes for ever more exotic coffees.

Nestle NESN.S, the market leader in packaged coffee, for example, has sealed a $7 billion licensing deal for Starbucks' retail business, while Europe's billionaire Reimann clan has built the JAB empire spanning coffee brands such as Kenco, Douwe Egberts and soft-drink maker Dr Pepper Snapple.

Bringing Costa shops to the key U.S. market would affect Starbucks, McDonald’s - a major Coke customer - and JAB, which owns a string of chains including Peet’s and Caribou.

Meanwhile, if Coke were to roll out canned or bottled Costa coffee drinks through its U.S. bottling system, that could upset the dominance of a joint venture between Starbucks and PepsiCo PEP.O, trade publication Beverage Digest said.

Cappuccinos sit on a table in Costa Coffee in Loughborough, Britain April 25, 2018. REUTERS/Darren Staples

The purchase of the biggest coffee chain behind Starbucks adds to Coca-Cola’s drive to diversify away from fizzy drinks and expand its options for increasingly health-conscious consumers, after countries started introducing sugar taxes.

Coke shares were down 0.4 percent in morning trade in New York as investors weighed the benefits of diversification against concerns about profitability.

“We do think investors will have questions surrounding the retail component of the business and lower operating profit margin versus legacy Coca-Cola,” said JP Morgan analysts.

Coke did not change its outlook for 2018 or beyond. The deal is expected to close in the first half of 2019.

CAFFEINE HIGH

Whitbread shares closed 14.3 percent higher following news of the deal, which analysts said was priced at a punchy 16.4 times Costa’s latest annual earnings.

“Coca-Cola are one of the few companies in the world that could justify the valuation,” said Nicholas Hyett, equity analyst at Hargreaves Lansdown.

“Its global reach should turbo-charge growth in the years to come, and hot drinks are one of the few areas of the wider beverages sector where the soft drinks giant doesn’t have a killer brand. Costa will get lots of care and attention.”

Whitbread had been in the process of demerging Costa from its hotel group Premier Inn, and the sale marks the latest transformation in a business that was established in 1742 as a brewer and which has also owned sports clubs and restaurants.

Whitbread bought Costa, founded in 1971 in London by Italian brothers Sergio and Bruno Costa, for 19 million pounds in 1995. It only had 39 shops then, but now its maroon shop front is one of the most ubiquitous sights on British high streets, with 2,422 outlets in the UK and a further 1,399 in international markets, operated as franchises, joint ventures and wholesale outlets.

Whitbread Chief Executive Alison Brittain said the price tag represented “a substantial premium” to what would have been created through a demerger.

“We were not interested in a sale other than to somebody who had a strategic rationale and therefore would be able to create significantly more value than Costa could create on its own.”

Some of the proceeds will go toward reducing Whitbread’s pension deficit and financial debt to ease expansion of the Premier Inn hotel chain in the UK and Germany, but Brittain said a “significant majority” of the cash would go to shareholders.

Brittain also denied Whitbread had been pressured to accelerate the sale by activist investor Elliott and other hedge funds. “I would imagine they would be as delighted and surprised as anybody else this morning,” she told reporters.

Elliott congratulated the board on the deal and said it “looks forward to continuing to engage with them to maximize the value of the remaining businesses”.

CAFE CULTURE

The global market for packaged coffee and drinks was worth about $83 billion in 2017, a fraction of the $513 billion market for soft drinks, according to Euromonitor International, but it is growing faster. What is more, sales at coffee shops like Starbucks and Costa are growing even faster, as people increasingly indulge their habit on the go, rather than at home.

Costa recently expanded into China to try to offset an increasingly saturated market in Britain, where chains such as Starbucks and Caffe Nero vie with thousands of independents.

A burgeoning cafe culture in China provides an encouraging backdrop, but Costa faces intensifying competition there as well. Starbucks, which has 3,400 stores in China, plans to almost double that by 2022, while partnering with Chinese tech giant Alibaba BABA.N to start delivery services.

Local rival Luckin also plans to more than double its Chinese store count to 2,000 by the end of 2018.

Rothschild advised Coke on the deal while Goldman Sachs, Morgan Stanley and Deutsche Bank advised Whitbread.

($1 = 0.7679 pounds)