California has fired the first salvo in what could be a national war on plastic bags.

Governor Edmund Brown on Tuesday signed into law a bill that bans plastic shopping bags, making California the first U.S. state to officially prohibit stores from handing them out for free.

"This bill is a step in the right direction -- it reduces the torrent of plastic polluting our beaches, parks and even the vast ocean itself," Brown said in a statement. "We're the first to ban these bags, and we won't be the last."

The ban is a victory for environmentalists who say the 13 million plastic bags that are handed out each year in the state end up in waterways and landfills where they don't break down for decades. Critics argue that the ban is misguided and will cost American jobs.

The new law goes into effect for large grocery chains and pharmacies beginning July 1, 2015. It will extend to convenience stores and liquor stores July 1, 2016.

Under the law, stores will be required to offer customers recycled paper bags or bags made of compostable material at a cost of at least 10 cents. Consumers buying groceries using California's food-assistance program won't have to pay for bags.

The law also provides $2 million in state-backed loans to help businesses transition to reuseable bags.

Related: How green is your state?

California is the first to ban plastic bags at the state level. But Hawaii has local ordinances on its four main islands that prohibit plastic bags.

Several cities and municipalities already have similar laws on the books. San Francisco became the first major U.S. city to ban plastic bags in 2007. Los Angeles announced a ban earlier this year. Seattle, Chicago, Portland, Ore. and Austin, Tx, are other cities where plastic bags are not welcome.

Some major retailers have also embraced the movement to reduce plastic bag use. Swedish furniture retailer Ikea, for example, offers only re-usable bags that customers must pay for. Whole Foods (WFM), the organic grocery chain, gives customers the option to recycle their plastic bags.

The ban in California was welcomed by grocery store owners in the state, who spend millions of dollars a year on plastic bags.

"History was made today, and our environment and economy will be better for it," said Ronald Fong, president of the California Grocers Association.

State authorities also praised the move, which should reduce the amount of money sanitation departments spend to clean up litter.

"A state plastic bag ban saves taxpayers the huge amount of money spent on litter cleanup, and protects the environment," said Leslie Tamminen, director of the Clean Seas Coalition, a group of lawmakers and environmentalists.

As the nation's most populous state, California's ban is seen as a bellwether for plastic bag legislation in other states.

Massachusetts, Pennsylvania, New York and New Jersey are all considering imposing a tax on plastic bags that customers would have to pay, according to the National Conference of State Legislatures. Rhode Island has introduced legislation that would require stores to recycle plastic bags.

Related: Rethinking the city building

The state legislature in California has tried several times to ban plastic bags over the years. Proponents say plastic bags are only useful for a few minutes, but can pose a threat to wildlife for decades. They also argue that bags made from petroleum products contribute to global warming.

"A throw-away society is not sustainable," said sate California Senator Alex Padilla, one of the authors of the bill. "Moving from single-use plastic bags to reusable bags is common sense."

But the campaign has been strongly opposed by plastic bag manufacturers.

The American Progressive Bag Alliance, a group that represents companies that make plastic bags, warns that banning plastic bags threatens up to 30,000 jobs across the country.

The alliance blasted the ban, calling the law a "backroom deal" between the grocers union and state legislators to "scam" consumers "under the guise of environmentalism." The group hopes to repeal the law and said it is gathering signatures to put the ban to a referendum in November.

"If this law were allowed to go into effect it would jeopardize thousands of California manufacturing jobs, hurt the environment, and fleece consumers for billions," the statement says.