California has banned pet stores from selling cats, dogs and rabbits unless they work with shelters or rescue groups to supply the animals.

Gov. Jerry Brown signed Assembly Bill 485 into law Friday, The Orange County Register reported. It takes effect in January 2019, and pet store owners who violate it will face a $500 fine.

The Democratic governor’s signature was celebrated by animal welfare groups, including Social Compassion in Legislation, the bill’s sponsor.

“We are overjoyed with the Governor’s signature and broad support from the entire animal-loving community for this groundbreaking legislation,” the group’s founder and CEO, Judie Mancuso, said in a statement. “In banning the sale of mill-bred animals, California took a bold step forward. The deplorable conditions that animals suffer in these high-volume breeding facilities are not a secret and now they have a champion in California.”

Patrick T. Fallon/The Washington Post via Getty Images One of the law's aims is to promote adoption from shelters and reduce animals killed. Orphaned, unweaned kittens are frequently killed in shelters without sufficient resources to care for them. This kitten is safe and in the care of the no-kill Best Friends Animal Society in Mission Hills, California.

In a statement sent to HuffPost, Matt Bershadker, president and CEO of the American Society for the Prevention of Cruelty to Animals, praised the law for breaking “the puppy mill supply chain that pushes puppies into California pet stores and has allowed unscrupulous breeders to profit from abusive practices.”

Pet industry representatives criticized the bill as being bad for business. It “strips consumers of many pet store protections, risks hundreds of jobs, and reduces pet choice,” Pet Industry Joint Advisory Council President Mike Bober said in a joint statement with the American Kennel Club, a registry of purebred dog breeds in the U.S.

In the statement, Sheila Goffe, the AKC’s vice president of government relations, criticized the legislation as blocking “all of California’s pet lovers from having access to professional, licensed, and ethical commercial breeders.”

The law will not prevent breeders from selling animals directly to customers, meaning that people who want to buy an animal from a breeder still can, but they won’t be able to do it through a retail pet store.

More than 230 cities, towns and counties across the U.S. have similar laws, but California’s is the first statewide law.

The law has two primary goals. One is to cut down on financial support of large-scale breeding facilities, some of which keep animals in deplorable conditions. Those so-called “puppy mills” (though they also exist for other species) often supply pet stores. The Humane Society of the United States notes that responsible breeders who care about their animals want to make sure they go to good homes, meaning they typically won’t sell them through a store that wouldn’t allow them to meet potential owners.

Secondly, the law aims to promote the adoption of homeless pets. The ASPCA estimates that 1.5 million companion animals were euthanized in shelters across the country last year. Assemblyman Patrick O’Donnell (D-Long Beach) said in a statement that in California alone, taxpayers spend more than $250 million each year “to house and euthanize animals” in shelters.