California has become the first state to require pet stores to sell only rescue animals, after Gov. Jerry Brown signed a law on Friday.

Under the new legislation, all dogs, cats, and rabbits sold in pet stores must come from animal shelters or non-profit rescue organizations by 2019.

Any pet store owner who does not comply will be fined $500 for each animal in violation of the law.

The law will work to reduce the mass-breeding of pets in "puppy mills" and "kitten factories," where they often face abuse and unhealthy living conditions, supporter said.

“This is a big win for our four-legged friends, of course,” Assemblymember Patrick O’Donnell, who wrote the bill, said. “But also for California taxpayers who spend more than $250 million annually to house and euthanize animals in our shelters.

"I am very grateful for the strong support we received from animal-lovers across the state and from Social Compassion in Legislation, the bill’s sponsor," he said.