NEWMARKET — At the urging of local teens, town councilors voted Wednesday night to adopt a new town ordinance that makes it illegal for anyone under 21 to buy, possess and use tobacco products and electronic cigarettes.

The 5-to-2 vote in favor of the new rule makes Newmarket the latest New Hampshire community to take action at the local level to target smoking among young people and the skyrocketing number of teens and pre-teens who have turned to the use of e-cigarettes for a nicotine fix.

The minimum age under state law is currently 18, but towns and cities can be more restrictive.

“I think parents need all the help they can get,” Chairman Dale Pike said before voting to support the ordinance.

The students from Newmarket Junior-Senior High School who pushed to raise the age from 18 to 21 are part of Newmarket Youth to Youth, an empowerment program that works toward drug and alcohol abuse prevention.

During a public hearing before Wednesday’s vote, freshman Lydia Zungy argued that while some people may say an 18-year-old should be able to decide whether to use tobacco products, the age to buy alcohol is 21 because it’s potentially dangerous and can create harmful situations.

“We feel that tobacco should be put on the same playing field as alcohol. Tobacco and nicotine products, including e-cigarettes, fall into this category because we have seen how addictive they can be,” said Zungy, who was joined by Caitlin Temple, Grace Lunney and Chloe Reynolds.

E-cigarettes, which contain various levels of nicotine, are often referred to as “vapes” and look like regular cigarettes, cigars, or pipes while others resemble USB flash drives, pens, or similar small devices.

The students spoke about the dramatic rise in vaping and the problems it creates at school, with users easily able to hide their devices.

Lunney, a sophomore, said some 18-year-olds have used social media to make offers to purchase the products for younger students in exchange for a financial incentive.

“It’s an avenue for other illegal substances,” she said.

The age change was met with some opposition.

Resident Sean Murphy raised several concerns, including enforcement of the law, taking away rights of those 18 to 20, the impact on Newmarket stores, and the precedent that it could set.

“If we decide next that fatty foods are not good for us or that caffeine is not good for us, if we can do this with tobacco, why can’t we do it with anything else? Where does it stop?” he asked.

Councilors Zachary Dumont and Gretchen Cast were the two who opposed raising the age to 21.

“I don’t think that we have the responsibility to force our will upon other people. I think it’s immoral. I think it’s irresponsible. I think that this ordinance should never have made it this far,” Dumont said.

Councilor Casey Finch said he’s a high school teacher and has seen how vaping has become a growing problem.

“It’s in every school. It’s not a Newmarket problem. It’s a teenager problem,” said Councilor Toni Weinstein.