Objectives. To examine the impact of local laws prohibiting tobacco sales in pharmacies in California and Massachusetts, the only 2 US states in which such municipal laws exist. Methods.We analyzed longitudinally the tobacco retailer density at the city level from tobacco retailer license data in California (2005-2013) and Massachusetts (2004-2014). Results. After adjustments, the reduction in tobacco retailer density over time was 1.44 (95% confidence interval [CI] = 1.37, 1.51) to 3.18 (95% CI = 1.11, 5.25) times greater in cities with a tobacco-free pharmacy law than in cities without such a law. Conclusions. Tobacco-free pharmacy laws are associated with a greater reduction in tobacco retailer density over time in California and Massachusetts.