Joelle Sedlmeyer via Getty Images This puppy is happy about the ruling.

A federal judge has upheld a Phoenix ordinance that bans pet stores from selling cats or dogs that come from commercial breeders.

The 2013 law, which The Associated Press said was designed to crack down on puppy mills, affected only one Phoenix pet shop, called Puppies ’N Love. The owner sued the city last year, claiming the ordinance was unconstitutional because it blocked interstate commerce.

U.S. District Judge David Campbell upheld the city ordinance on July 27. He called Puppies ’N Love an “exemplary” store that avoided buying from puppy mills, but noted the court’s job was “not to judge the wisdom or fairness” of the law, just to determine whether it was constitutional.

At least 58 other U.S. cities and counties have similar laws, according to the Humane Society of the United States.

The Phoenix law says “pet stores may only sell animals obtained from animal shelters or rescue organizations,” according to documents in the court case. It permits small-scale individual breeders to sell dogs directly to purchasers. The ordinance also prohibits carnivals and amusement parks from awarding animals as prizes, AZ Central reported when it passed.

Puppies ’N Love was the lone store in the city still selling commercially bred dogs and cats, according to the court documents. Some Phoenix pet shops partner with animal shelters to help them adopt out animals, according to AZCentral.

Frank Mineo, the owner of Puppies ’N Love, said he didn't purchase dogs from puppy mills, but from reputable small-scale breeders. According to court documents, three breeders he had purchased from in the past had been cited for violating U.S. Department of Agriculture standards.

The judge noted in his decision one of those breeders was “arguably a prototypical puppy mill,” with six employees taking care of 700 dogs that were kept “in small enclosures without solid flooring.” Mineo “disputed” that characterization, according to court records, but said he no longer got puppies from that breeder.

HuffPost's Arin Greenwood contributed reporting.

Contact the author of this article at Hilary.Hanson@huffingtonpost.com.

PHOTO GALLERY Puppies!