The Trump administration on Thursday announced a limited ban on certain flavors of cartridge-based e-cigarettes, stopping short of completely eliminating all types of vaping products.

The announcement comes after months of public back-and-forth from President Trump over how to address the vaping issue without angering either side of the debate.

The new policy was intended as a targeted move, aimed only at the products health officials said put teens at risk. It was prompted by federal data that showed more than 5 million middle and high school students reported using e-cigarettes within a 30-day window. Most of the students said they used cartridge-based products.

But the move was immediately panned by Democrats, as well as anti-tobacco groups, who accused the administration of caving to the tobacco industry.

"The White House has done what the industry said it could live with, not what the public health community said was needed," said Matthew Myers, president of the Campaign for Tobacco Free Kids.

The announcement is a victory for free market groups and the vaping industry, which pressured the administration to change course from its earlier decision over concerns that a total flavor ban would put independent vape shops out of business.

Under the policy unveiled by the Food and Drug Administration, the administration will strip the market of popular fruit and mint pod-based flavors, but not tobacco and menthol. Pod-based products, like those manufactured by Juul and NJOY, are the most popular with teens.

"Our action today seeks to strike the right public health balance by maintaining e-cigarettes as a potential off-ramp for adults using combustible tobacco while ensuring these products don't provide an on-ramp to nicotine addiction for our youth," Health and Human Services Secretary Alex Azar said.

Juul has dominated the e-cigarette market with their sleek, flash drive-shaped devices, and the popularity of their fruity flavors has led public health experts and federal health officials to blame the company for the current teen vaping "epidemic."

Anticipating a potential ban, Juul earlier this year pulled all its fruity flavors from the market, such as mango, creme, fruit and cucumber. It continues to sell tobacco and menthol.

Open tank systems, which are commonly found in vaping shops and not as popular with young people, will be exempt from the policy, even though they use flavored "e-liquids."

According to FDA, companies that do not stop manufacturing, distributing and selling unauthorized flavored cartridge-based e-cigarettes other than tobacco or menthol within 30 days risk enforcement actions. The clock starts ticking once the agency formally publishes the guidance.

"We will not stand idly by as this crisis among America's youth grows and evolves, and we will continue monitoring the situation and take further actions as necessary," Azar said.

The move is meant to combat a surge in youth vaping, but is a retreat from the comprehensive vaping ban announced by Trump and top health officials in September.

At the time, Trump, Azar and other top health officials announced their intent to clear the market of every flavor of e-cigarettes except for tobacco. But they instead set off a firestorm of protests among conservatives and industry, leading Trump to waver.

During a tense meeting at the White House in November, Trump pitted vaping industry representatives against anti-tobacco advocates. At that meeting, Trump signaled he was walking back the long-delayed proposal.

Since then, the White House has held regular meetings on the subject, with White House counselor Kellyanne Conway among those involved in discussions. But it's unclear how directly Trump himself was taking part in the day-to-day debate.

Democrats, and even some Republicans, urged Trump not to back down, but he eventually scrapped the earlier policy after being warned of potential political consequences.

On Thursday, some of the administration's harshest critics on vaping offered tempered praise for the announcement.

The "temporary ban on flavored pods that entice kids is a positive step, but more must be done. I will continue to work with the administration to protect our kids from illness and addiction," tweeted Sen. Mitt Romney (R-Utah), who attended the November meeting.

Sen. Dick Durbin (D-Ill.), the No. 2 Senate Democrat, called it a "positive step," but also noted the policy has some "gaping holes."

Other Democrats panned the new policy.

Sen. Patty Murray (D-Wash.), the top Democrat on the Senate Health Committee, said Trump broke his promise, and accused newly-appointed FDA Commissioner Stephen Hahn of siding with Trump over science.

"President Trump has sold out young people to tobacco companies by breaking his promise to clear the market of all nontobacco flavored e-cigarettes, and giving tobacco companies huge loopholes for kid-appealing flavors," Murray said in a statement.

Rep. Frank Pallone Jr. (D-N.J.), chairman of the House Energy and Commerce Committee, said the pressure is now on Congress to act. Legislation that would ban all flavors and put other restrictions on tobacco products cleared his committee in November.

"A public health epidemic of this magnitude requires bold, decisive action. Unfortunately, the Trump Administration caved to industry lobbying pressure and decided to prioritize politics over people's health," Pallone said.

A measure included in the year-end spending bill signed by President Trump will ban sales of any tobacco products to anyone under the age of 21. That move was backed by the tobacco industry, which had hopes of avoiding any more serious regulation.

-- Brett Samuels contributed

-- Updated at 5:12 p.m.