Bo, a Shiba Inu and one of 23 dogs rescued from South Korea, looks out from his kennel at the Animal Welfare League of Alexandria shelter in Alexandria, Virginia, Jan. 9, 2015. A recent decision barring pet stores in Phoenix from selling dogs and cats raised by commercial breeders upheld a city ordinance passed in December 2013. Getty Images

A federal judge in Phoenix recently upheld a city law requiring all dogs and cats sold in pet stores to come from an animal shelter, the Good News Network reported Monday. Last week, Phoenix joined roughly 60 other cities in the U.S. that have similar laws in place.

The decision barring pet stores from selling dogs and cats raised by commercial breeders upheld a Phoenix ordinance passed in December 2013, the Arizona Republic reported. The ordinance sought to address the city’s population of homeless dogs and cats, and was backed by the Humane Society of the United States as a way to curb puppy mills, which are defined as inhumane, commercial dog-breeding facilities.

A pet store in Phoenix, though, challenged the ordinance in July 2014, arguing that it violated state and federal commerce laws and would force the store to close. The decision was handed down Friday, and U.S. District Judge David G. Campbell ruled that the ordinance was constitutional.

Many activists have hailed the court’s decision. Phoenix City Councilwoman Thelda Williams helped lead efforts to pass the ordinance, and many local residents and organizations have said they sent her emails expressing their gratitude.

A puppy is shown reacting to loud barking from dogs in their cages at the San Bernardino City Animal Shelter in San Bernardino, California, Feb. 4, 2014. Getty Images

“I hope the pet industry is paying attention, and instead of spending so much of their time and resources fighting these ordinances will instead devote their time toward improving the industry,” said Melanie Kahn, the Humane Society’s senior director, Arizona Central reported.

Not everyone was pleased with the ruling, though. Mike Bober, executive vice president of the Pet Industry Advisory Council, an advocacy group that promotes pet ownership and pet owners’ rights, said the ruling was well-intentioned but lamented it would do more damage than good. The ordinance will not shut down a single puppy mill and the ruling will most likely hurt responsible, federally licensed and regulated breeders, Bober said.

Around 23,000 dogs are sold in Phoenix-area pet stores every year, and shelter animals can spend days or months awaiting adoption. Many laws similar to the one held up in Phoenix are designed to cut wait time and overcrowding in shelters.

Correction: A previous version of this article incorrectly referenced animal shelters in the headline. It is pet stores, not animal shelters in Phoenix, Arizona that are forbidden from selling dogs and cats that were raised by commercial breeders. The previous version also incorrectly characterized puppy mills, which are more accurately defined as inhumane, commercial dog-breeding facilities. The article has since been updated to reflect these facts.