San Francisco has brought in a new law saying that pet shops can only sell cats and dogs that come from rescue centres.
Selling animals under 8 weeks old has also been stopped under the new rule
Katy Tang, one of the politicians who helped to bring in the ban, said that she did it because she doesn't think some pet stores spend enough time thinking about animals' health or well-being.
She says sometimes puppies and kittens are not treated as well as they should be and animals can also be sold when they are very young - before they are ready to leave their parents.
San Francisco isn't the first place in America to bring a rule like this in.
A number of other cities in America - like Phoenix in Arizona and Montgomery County in Maryland - also have laws which mean cats and dogs being sold in pet shops must come from rescue centres.
In the UK, pet shops can't sell cats or dogs that are under 8 weeks old and the pet shops have to be given a license by the authorities in their area.