Nearly all teenagers will be barred from buying e-cigarettes or their analog counterparts in Maryland after Tuesday, when hundreds of new laws — including a higher smoking age — take effect.

Maryland joins the District and 14 other states that restrict nicotine sales in an effort to curb an alarming surge in teen vaping. Approved in the spring, Maryland’s law takes effect amid nationwide concern about the safety of vaping both nicotine and marijuana products, with more than 800 cases of vaping-related lung diseases reported in 46 states since August. Twelve deaths have been reported.

Maryland’s law increases the buying age for tobacco from 18 to 21 for everyone except active-duty members of the military.

The chief architect of the statute, House Economic Matters Committee Chairman Dereck E. Davis (D-Prince George’s), plans to introduce legislation in January to completely ban flavored vaping products, which public health officials contend make e-cigarettes more appealing to young people.

“The goal is to try to keep it out of the hands of kids as long as possible,” Davis said Friday. “The longer we can keep it out of their hands, the more we can prevent them from being lifetime users.”

President Trump has proposed a nationwide ban on most ­flavored e-cigarettes.

Several hundred other laws affecting a variety of issues, including diaper prices and renewable energy, also take effect Tuesday in the Washington region.

In the District, the new budget year brings an end to free rides on the Circulator bus. Fares will again cost $1.

No sales tax will be charged on the sale of diapers in the city, now that a 2016 law is fully implemented.

And sugary drinks — including some juices and iced coffee drinks — will now be subject to as much as a 10 percent tax.

In Maryland, the bulk of legislation passed by the General Assembly this year will become law.

The state will now offer ­gender-neutral driver’s licenses that permit residents to select “X” rather than “male” or “female” on their ID cards, demonstrating a growing public acceptance of people with non-binary gender identities.

All Maryland public schools will be required to spend part of one day each year during Black History Month teaching about two of the state’s most storied figures and their contributions to ending slavery: Harriet Tubman, an abolitionist born into enslavement who escaped and became a well-known conductor on the Underground Railroad and a spy for the Union Army; and Frederick Douglass, the famed orator, author, statesman and abolitionist who, like Tubman, was born into enslavement on Maryland’s Eastern Shore.

Maryland will also now allow same-day voter registration for the 2020 election and beyond, a change that is part of Democrats’ years-long effort to boost participation in elections.

The state’s most ambitious attempt yet to address climate change by relying on renewable energy sources also becomes law. The Clean Energy Jobs Act requires the state to derive half of its electricity from renewable sources such as wind and solar by 2030.

It replaces the current goal, to get a quarter of Maryland’s electricity from renewable energy by the end of next year, and has spawned a thorny question about where to put all of the solar panels needed to meet the higher goal.

The hefty policy moves are taking effect alongside more populist initiatives. All state-owned public buildings must now have diaper-changing facilities in bathrooms. Organizers of esports competitions will now be allowed to offer cash prizes, which could clear the way for Maryland to host video-game tournaments.

Meanwhile, tougher penalties for repeat drunk drivers also become law: A third offense comes with as much as a five-year jail term, and a fourth could mean a decade behind bars.

Amid a rise in hate crimes across the country, Maryland lawmakers decided it should be a crime to threaten one, not just to carry one out. Threatening a hate crime will now be a misdemeanor offense.

New laws aimed at identifying human trafficking victims and prosecuting traffickers will also now be on the books, including an effort to train truckers on the Interstates 95 and 70 arteries to look for signs of human trafficking and report it.

People convicted of animal cruelty offenses could now be ordered to pay to rehabilitate animals they abused and be forced by a judge into psychological counseling.

Fenit Nirappil contributed to this report.