Gov. Phil Murphy on Wednesday signed a law that bans retailers, fast-food restaurants, and supermarkets from providing single-use plastic carryout bags, paper bags, and foam containers including cups. The change is being called one of the toughest laws of its kind in the country and hailed by local environmental groups.

The legislation -- sponsored by State Sen. Bob Smith (D., Middlesex, Somerset), chair of the Senate Environment and Energy Committee, and co-sponsored by others -- was several years in the making and faced opposition along the way. It goes into effect in May 2022.

“Plastic bags are one of the most problematic forms of garbage, leading to millions of discarded bags that stream annually into our landfills, rivers, and oceans,” Murphy said in a statement. “With today’s historic bill signing, we are addressing the problem of plastic pollution head-on with solutions that will help mitigate climate change and strengthen our environment for future generations.”

Legislators said an estimated 100 billion single-use plastic carryout bags and 25 billion styrofoam plastic coffee cups are tossed away each year in the United States.

Less than 10% of all plastics in the United States get recycled. An even smaller share of single-use plastics are ever recycled because material-recovery facilities are not equipped to handle it, and there is little demand for it on recycling markets.

The lawmakers said that much of the plastic, the product of fossil fuels, ends up in landfills, is incinerated, or becomes litter on land and waterways, including the ocean, where it is ingested by marine life.

“The Legislature therefore determines that it is no longer conscionable to permit the unfettered use and disposal of single-use plastics in the State,” lawmakers wrote.

But they went further, adding paper carryout bags from larger grocery stores, and polystyrene foam containers typically used by restaurants.

The law applies to grocery stores, restaurants, delis, coffee shops, convenience stores, food trucks, movie theaters, and cafeterias, including those operated by or for government agencies. Though plastic straws are part of the ban, a restaurant may provide them solely at customer request starting in November 2021.

Stores or restaurants violating the ban are subject to a first-time warning, then face a $1,000 fine for a second offense, and up to $5,000 for additional offenses.

Some products would be exempt for two years after the law goes into effect, such as long-handled plastic soda spoons used for milk shakes, small cups used for hot foods or liquids that require lids, trays used for raw or butchered meat and fish, and food that’s already prepackaged by manufacturers.

Lawmakers were hopeful that the state’s hemp growing industry might one day be part of the supply chain for biodegradable packaging that could take the place of some single-use plastic and paper. Such products break down in about 90 days as opposed to years.

Eight states -- California, Connecticut, Delaware, Hawaii, Maine, New York, Oregon, and Vermont -- have banned single-use plastic bags, according to the National Conference of State Legislators. And five -- Connecticut, Delaware, Maine, Oregon, and Vermont -- have placed restrictions on straws and foam containers.

Some states have a mix of fees or bans on paper bags, while some promote the use of paper bags over plastic.

New Jersey’s prohibition on both single-use paper and plastic makes it among the most sweeping in the nation. Already, 55 municipalities in the state have passed ordinances limiting or prohibiting single-use plastic bags. The new law will supersede them.

That move resulted in support from the New Jersey Food Council, which counts some of the state’s largest grocery stores and producers as members, such as Acme, Pepsi Beverages, Wawa, Wegmans, and Whole Foods.

Linda Doherty, president and CEO of the council, said the law does away with the “proliferation of varying local ordinances” that created a patchwork of laws. Plus, she said, the group supports the goal.

“NJFC has continually advocated for a uniform statewide standard to phase out single use plastic and paper bags and encourage the use of reusable bags in New Jersey,” Doherty said in a statement. “The action taken by the governor today does just that.”

“This is a major win in our battle against plastic pollution,” said Jeff Tittel, director of the New Jersey Sierra Club. “This is the most comprehensive and strongest plastic bill in the nation. This new law will protect New Jersey from plastic that not only hurts the environment but also endangers our wildlife and public health. It will go a long way in our battle against plastics.”

Cindy Zipf, executive director of Clean Ocean Action, which leads sweeps each of year of New Jersey beaches, called it “a good day for marine critters and the power of the people.”

Doug O’Malley, director of Environment New Jersey, said plastics “we use for 15 minutes should not end up in our environment and communities for endless generations." He thanked Murphy not only for signing the law but for vetoing a weaker version two years ago in favor of holding out for a stronger ban.