As part of an ongoing effort to make his city healthier, New York Mayor Michael Bloomberg signed legislation to prohibit the sale of tobacco products in the five boroughs to anyone under 21.

The new law effects both traditional and electronic cigarettes, which lawmakers say will keep the city’s youth from picking up harmful habits, and prohibit older teens buying for younger ones, according to The Los Angeles Times. In addition, chewing tobacco, rolling papers, pipes, powdered tobacco and cigars will be prohibited for anyone under 21.

The ban has its limitations, though. According to CBS News, teens can still possess and use tobacco products legally. Under-21s can still take cigarettes from parents, bum them from friends or buy them from black-market dealers common in many neighborhoods.

According to studies conducted by the city, about 19,000 New York high school students are smokers, The Los Angeles Times reports. About 80 percent of city smokers started before they were 18.

City Health Commissioner Thomas Farley said the idea is to make it harder for young people to get started, CBS News reports. “Right now, an 18-year-old can buy for a 16-year-old,” CBS News reports Farley said at the signing ceremony. Now younger people will “have to find someone in college or out in the workforce.”

City officials say youth smoking levels have been declining since 2002, but the decline has bottomed out since 2007, according to The Los Angeles Times. Bloomberg and others felt more aggressive legislation was necessary to curb the problem. 

This isn’t the first health-related law Bloomberg has signed. Since taking office, the mayor has banned smoking in most public places, legislated the use of trans fats in prepared foods, required major restaurant chains to list calories next to menu items and worked to limit sales of super-sized sodas, according to The Los Angeles Times.

The law, which goes into effect in 180 days, will require retailers to post the new age requirement “in a conspicuous location” and to verify customers' ages by checking IDs, according to The Los Angeles Times. Also included in the bill was a measure that sets the minimum price for a pack of cigarettes at $10.50.

If storeowners violate the law by selling to a person under 21, they can face fines up to $1,000 per violation found in single day, and up to $2,000 for a second violation, according to CBS New York. Retailers can lose their license to sell tobacco products for repeated offences.

The framers of New York City’s law cited specifically the success of Needham, Mass., a Boston suburb that enacted the same prohibition in 2005, according to Slate magazine. Needham’s adult smoking rate is now 56 percent lower than the overall rate in Massachusetts, according to the state’s Department of Public Health.

Similar legislation is on the table in Washington, D.C., Hawaii and New Jersey, according to Slate.

 At the City Hall signing ceremony, Bloomberg said, "this is an issue of whether we're going to kill people," The Los Angeles Times reports. "This century, a billion people will die from smoking around the world, and we don't want any of the people that die to be New Yorkers.”