The council voted 28-20 for the bill, which will take effect on Oct. 1. It is supposed to encourage people to bring along reusable bags when they go shopping.

Co-sponsor Councilman Brad Lander (D-Brooklyn) first introduced the legislation in 2013 with the goal of dramatically reducing the use of plastic bags in the city.

“It works by irritating us into changing our behavior and remembering to bring reusable bags,” said Lander ahead of the City Hall hearing.

Lander added, “While it may be contentious today, [the bill] is going to help New Yorkers together solve a real environmental problem.”

The councilman and other backers of the bill, like co-sponsor Councilwoman Margaret Chin (D-Manhattan), say the fee would reduce 60 to 90 percent of the more than 9.3 billion plastic bags New Yorkers throw away annually by promoting the use of reusable bags.

“Plastic bags aren’t really free. They cost our city millions of dollars to transport as waste. They litter our streets,” said Chin.

“The number of plastic bags being used in our city has become an environmental hazard,” said Mark-Viverito, calling it an “important bill.”

‘It smells like a tax, looks like a tax, acts like a tax — it’s a tax … a tax that will cost New Yorkers hundreds of millions of dollars a year.’

- Councilman Steven Matteo

When asked if she uses reusable bags, Mark-Viverito replied, “Right now I don’t and I will have a motivation to use the reusable bags — and I’m more than happy to do that.”

Backers of the bill noted that the nickel surcharge is not a tax as it goes directly to the retailers and not the city, but opponents don’t see it that way.

“It smells like a tax, looks like a tax, acts like a tax — it’s a tax … a tax that will cost New Yorkers hundreds of millions of dollars a year,” said Councilman Steven Matteo (R-Staten Island), who added that his south Staten Island constituents will travel to New Jersey to shop to avoid the fee.