A bill to be introduced in the New York City Council on Thursday would require all bikers, no matter their age, to wear a helmet when cycling in the five boroughs.

Passing the controversial legislation, sponsored by Council Member David Greenfield of Brooklyn, could be an uphill battle. Mayor Michael Bloomberg, who has been criticized for imposing laws on the city that some see as nanny-esque, opposes the bill, an aide confirmed.

Bicycling in New York City is booming. More than half a million New Yorkers ride a bike at least several times a month, and the number of people commuting by bicycle doubled between 2007 and 2011, city statistics show. This summer, the city will begin a high-profile bike-share program that is expected to flood city streets with thousands of new bicycles.

"The best way to get killed if you're riding a bicycle is to not wear a helmet," Mr. Greenfield said. "We want to encourage people to be safe."

According to the legislation, a first offense would be punishable by a fine of up to $25. A second citation during a one-year period would carry a $50 fine, and a third offense within two years could cost $100.