As soda consumption declines in the U.S., Coca-Cola and PepsiCo are trying to leverage the name recognition of their legacy brands to make a bigger dent in the growing energy drink category.

Coke plans to sell Coca-Cola Energy in 20 countries by the end of 2019. The energy drink contains naturally sourced caffeine, guarana extracts and B vitamins. Rival Pepsi is continuing its efforts to move its Mountain Dew line into the energy drink category and has not ruled out trying to do the same with its namesake soda brand.

Sugary drinks have fallen out of favor with health-conscious consumers. Coke's response, which has included hiking soda prices and launching its Zero Sugar line, helped it top earnings estimates Tuesday. Energy drinks could be another opportunity. The category has largely managed to buck the trend.

Total energy drink and energy shot sales in the United States grew by 29.8% from 2013 to 2018, reaching an estimated $13.5 billion in sales last year, according to Mintel data. Energy drinks, which represent 92% of the energy market, are entirely responsible for that growth, Mintel found.

Monster Beverage tried to stop Coke from selling Coca-Cola Energy, arguing that it violated the terms of its contract with the beverage giant. In 2015, as part of a long-term distribution partnership, Coke received a 16.7% stake in Monster, as well as two seats on its board and the energy drink company's non-energy portfolio. Monster, in turn, got Coke's energy business.

An arbitration panel ruled in July that Coke can sell the energy drink globally under its contract with Monster. Despite speculation that Coke might sell its stake following the ruling, Coca-Cola CEO James Quincey said on the conference call Tuesday that the company remains committed to its partnership with Monster.

Monster Energy is far and away the market leader for energy drinks, representing 43% of sales, according to data from Beverage Digest.

"They've created a great business and a great brand, and we've helped them take it to the next level," Quincey said on CNBC's "Squawk on the Street" Tuesday.

Quincey added that Monster is still growing, and that Coke envisions a different type of consumer for its energy drink. The company views Coca-Cola Energy as a "softer flavor competitor" than other energy brands. Early results show that the energy drink is attracting customers who don't usually consume energy drinks or who do not drink Monster, he said.

In Spain, Coke Energy's first market, the drink has already managed to capture a 2% share of the energy category since its launch in April, according to Quincey.

Executives did not share any plans to launch Coke Energy in the U.S. just yet but said that the company could benefit from waiting to learn more from early markets.