Mayor Michael Bloomberg signed landmark legislation Tuesday banning the sale of tobacco products to anyone under age 21, making New York the first large city in the country to prohibit sales to young adults.

City health officials hope that raising the legal purchase age from 18 to 21 will lead to a big decline in smoking rates in a critical age group. A majority of smokers get addicted to cigarettes before age 21, and then have trouble quitting, even if they want to do so.

The ban has limitations, in terms of its ability to stop young people from picking up the deadly habit. Teenagers can still possess tobacco legally. Kids will still be able to steal cigarettes from their parents, bum them from friends or buy them from the black-market dealers who are common in many neighborhoods.

But City Health Commissioner Thomas Farley said the idea is to make it more inconvenient for young people to get started, especially young teens who had previously had easy access to cigarettes through slightly older peers.

"Right now, an 18-year-old can buy for a 16-year-old," he said. Once the law takes effect in six months, Farley said that 16-year-old would "have to find someone in college or out in the workforce."

Tobacco companies and some retailers had opposed the age increase, saying it would simply drive teenagers to the city's thriving black market.

"What are you really accomplishing? It's not like they are going to quit smoking. Why? Because there are so many other places they can buy cigarettes," said Jim Calvin, president of the New York Association of Convenience Stores. "Every 18-year-old who walks out of a convenience store is just going to go to the guy in the white van on the corner."