The law, which goes into effect immediately, targets devices that turn semiautomatic handguns into makeshift machine guns.
The Birmingham mayor, who lost a brother and nephew in shootings, has expressed frustration over gun violence in his city.