Trying to gain ground in the energy drink market, Coca-Cola has bought a 16.7 percent stake in Monster for $2.15 billion.

As part of the deal, Monster will take over Coke’s small energy drink business, while Coke will absorb the former’s non-energy drink brands.

Coke said it also has the option to boost its stake in Monster to 25 percent.

Atlanta-based Coke is under pressure to find new products as its core soft drink business struggles in North America, where concerns about the effect of sugary beverages on waistlines and health have flattened soda sales the past few years.

The deal gives Coke a stronger position in the robust and growing energy category. Coke’s own entrants — including NOS and Full Throttle — have lagged compared to Monster and Red Bull.

“This is a big and important deal for Coke,” said John Sicher, editor and publisher of Beverage Digest. “Monster, by volume, leads the energy drink business in the U.S. Last year, it had a 37.9 share and out-performed the energy drink category. It is an important and powerful brand.”

Reports of discussions between Coke and Corona, Calif.-based Monster started more than two years ago, with Coke initially denying talks.

The brand-swap deal “generates scale and better opportunity of customer impact points,” Coke Chief Executive Officer Muhtar Kent said in an interview with media after the news broke.

Coke has an option to take up to 25 percent of Monster through open market and private purchases, Kent said, adding “We will evaluate options from time to time.”

The soft drink giant, which had 50 percent distribution partnership with Monster in the United States (Budweiser had the other half), will get a bigger share of that distribution, Kent and Rodney C. Sacks, Monster’s chairman and chief executive officer, said.

Coke has made several acquisitions over the past few years. Coke bought Vitaminwater maker Glaceau for $4.1 billion in 2007 and the U.S. and Canadian bottling operations of its largest bottler Coca-Cola Enterprises for $12.3 billion in 2010.