Spurred by a sharp rise in teen use of e-cigarettes, the Maryland legislature voted Wednesday to raise the legal age to buy tobacco from 18 to 21.

Maryland Gov. Larry Hogan (R) has not said whether he will sign the bill, which exempts members of the military.

The proposed law is one of several similar measures advancing across the country this year and comes as the Food and Drug Administration has taken steps to crack down on flavored cigars and vaping cartridges popular with young people. Outgoing FDA Commissioner Scott Gottlieb has said teen vaping use nationwide has become “an epidemic.

The District and eight states, including neighboring Virginia and California and Massachusetts, already set the smoking age at 21. Illinois, Washington and New York are poised to raise the age this year, too.

In Maryland, about 1 in 5 high school students report using some tobacco products regularly, and more than 35 percent say they’ve tried vaping pens or e-cigarettes, according to the most recent Maryland Youth Risk Behavior survey.

Teen smoking rates had been on the decline for years, but public health advocates and the U.S. Food and Drug Administration say the popularity of e-cigarettes threatens to erase a generation of progress.

“Vaping’s all the rage, it seems,” said Del. Dereck E. Davis (D-Prince George’s), who introduced the legislation this year. “There’s this thought that somehow vaping is safe, but nothing is further from the truth.”

The Centers for Disease Control and Prevention reports that nationally, 20 percent of high school students said they used electronic cigarettes in the previous month, up from 1.5 percent in 2011. The use of any nicotine products by teens concerns public health advocates because most adult smokers — 90 percent — say they tried their first cigarette by age 18, according to the CDC.

In Maryland, lawmakers made an exception for service members, who will be able to buy tobacco at 18 by showing a military ID. Sen. Michael J. Hough (R-Frederick) pushed the exemption and said that, as an Air Force veteran, he found it “offensive” that the country found 18-year-olds mature enough to die in combat but that states did not trust them to make good decisions about their health.

The legislation has been a top priority for the Legislative Black Caucus, which said smoking has had a long-lasting toll on the African American community.