During a hearing that ran late into the night on Thursday, supporters of the ban said animal shelters are overrun by people who buy hamsters, parrots, snakes and other animals from pet stores on impulse, then regret the purchase.
Under the proposal, San Francisco residents would have had to go outside the city to purchase pets.
Pet store owners argued against the measure, telling the city's Commission of Animal Control and Welfare it would put them out of business.