The plastic bag at California grocery stores has headed the way of lead paint, shark fin soup and ivory.

With strong support in liberal coastal counties swamping opposition in the Central Valley, environmental groups won a major victory with the passage of Proposition 67, making California the first state in the nation to ban carry-out plastic bags at grocery stores.

Although some absentee and provisional ballots were still being counted Thursday afternoon, the measure led 52 to 48 percent, and the plastic bag industry, which had fought it, conceded defeat.

The new law, which environmentalists say is vital in reducing litter and ocean pollution, takes effect in about five weeks after the California Secretary of State certifies the election Dec. 16.

Already, 17.3 million people in 151 cities and counties in California, including Los Angeles, San Francisco, San Jose, Santa Cruz, Palo Alto and Oakland, live in areas where plastic grocery bags have been banned by local ordinances in recent years. But another 22 million who live in places where the bags were not outlawed are in for a change.

Dave Heylen, a spokesman for the California Grocers Association, said he expects customers will see plastic bags phased out in the coming days.

“In a lot of communities, stores have already converted,” he said, “or they started ramping up for it and making sure they had the bags, or educating consumers to make sure they bring reusable bags.”

Heylen said the grocery industry opposed San Francisco’s early efforts a decade ago to ban plastic grocery bags, but it shifted to support the concept when other cities passed similar measures.

“Rather than a patchwork, we wanted it to be consistent across the board,” he said. “We can deal with that from a business standpoint. It’s not a burden.”

Environmentalists said they expect other states to follow California’s lead.

“This is an important victory to reduce plastic pollution in California,” said Mark Murray, executive director of Californians Against Waste. “California voters said yes to the environment and no to big money and the special interests.”

Proposition 67 was put on the ballot by companies that manufacture plastic bags. Their goal was to overturn a law that Gov. Jerry Brown signed in 2014, SB 270, that banned plastic grocery bags statewide and required grocery stores to charge at least 10 cents for paper bags. The law does not affect plastic produce bags, newspaper bags, or bags in restaurants and other stores.

By putting the law on hold, approximately another 10 billion bags were sold, which netted the bag industry roughly $20 million, Murray said.

A handful of companies, including Hilex Poly, Superbag and Advance Polybag, based in South Carolina, Texas and other states, spent $6 million on the campaign, and a related measure they sponsored, Proposition 65, which would have required the money grocery stores collect by selling paper bags to fund state environmental programs. Proposition 65 was defeated.

“California voters have unfortunately set themselves up for a serious case of buyer’s remorse,” said Lee Califf, executive director of the American Progressive Bag Alliance, an industry group. “Plastic bag bans don’t meaningfully reduce overall waste or litter or provide a positive environmental impact, but they do threaten tens of thousands of American manufacturing jobs.”

Murray noted that cities, which already have banned plastic bags, like San Jose, have seen reductions in litter and have saved taxpayers the costs of picking it up and unclogging storm drains.

The law allows cities and counties to fine grocery stores up to $1,000 a day for violations. But no store has been fined under local ordinances, Murray said, and his group is instead pushing education.

Paul Rogers has covered a wide range of issues for The Mercury News since 1989, including water, oceans, energy, logging, parks, endangered species, toxics and climate change. He also works as managing editor of the Science team at KQED, the PBS and NPR station in San Francisco, and has taught science writing at UC Berkeley and UC Santa Cruz.