Los Angeles lawmakers on Wednesday voted in favor of an ordinance that will make L.A. the largest city in America to ban pet stores from selling dogs, cats and rabbits obtained from commercial breeders.

The ordinance, which the City Council voted 12-2 to approve, targets puppy mills and is designed to cut down on the tens of thousands of animals euthanized each year in city shelters.

Under the law, individuals will still be allowed to buy directly from breeders, and pet stores will be allowed to sell animals that come from shelters, humane societies and registered rescue groups. Stores found to be selling animals from breeders may face misdemeanor charges and a first-time penalty of $250.

Animal rights activists hailed L.A.’s approval of the ban as a signal to other large cities to follow suit. Irvine, Hermosa Beach and West Hollywood are among the more than 30 cities across the United States and Canada that have passed similar measures in recent years, according to Elizabeth Oreck, who has been leading the legislative effort on behalf of Best Friends Animal Society.

L.A.'s ban also sends a message, she said, to breeders who frequently cut corners to keep costs low at the expense of the animals.

“They’re inbred, they’re overbred, they're irresponsibly bred,” Oreck said.

But pet shop owners complained the ordinance is misguided and unfair.