Michigan has become the first state to prohibit sales of most flavored e-cigarettes in a bold move to curb the underage vaping epidemic.

The ban will cover both online and in-store sales of all e-cigarette flavors except tobacco. It will take effect in a few weeks, and allow businesses 30 days to comply.

Gov. Gretchen Whitmer said the goal is to get flavors like "Fruit Loops, Fanta and Nilla wafers" out of the hands of children and teens.

"Behind the candy taste, however, is a product that hooks kids and adults alike: E-cigarettes can deliver nicotine more than twice as quickly as tobacco cigarettes," Whitmer wrote in a letter to Michigan state senators.

"I am committed to protecting public health," she added. "There is no doubt that keeping nicotine out of the hands of kids is one of the most powerful ways to fulfill that commitment."

Leading public health groups applaud Whitmer's move.

In a joint statement, the American Heart Association, American Academy of Pediatrics, American Cancer Society, American Lung Association, the Campaign for Tobacco-Free Kids and the Truth Initiative called Whitmer's action "necessary and appropriate."

"In the absence of strong federal regulation, parents have been blindsided by the e-cigarette epidemic," the groups wrote. "The time for waiting is over. The FDA must immediately remove all flavored e-cigarettes from the market nationwide, prohibit all marketing to children and prohibit online sales of e-cigarettes."

The popularity of e-cigarettes among teenagers has skyrocketed in recent years. In February, the Centers for Disease Control and Prevention reported a 78 percent increase in high school students vaping from 2017 to 2018.

Last week, the Michigan Department of Health and Human Services reported that the state is investigating six cases of severe respiratory illnesses linked to vaping.

An NBC News survey of state health departments has revealed at least 329 confirmed or possible cases nationwide.

There has been one confirmed death from the illness, in Illinois. A possible second death is under investigation in Oregon, where health officials say a person died of severe respiratory illness after vaping.

The CDC is working with states to try to pinpoint an e-cigarette ingredient, e-liquid, device or purchase method linking the cases.

Follow NBC HEALTH on Twitter & Facebook.