BOSTON — Massachusetts lawmakers have approved a ban on “bump stocks,” devices that can increase the firing rate of a weapon.

If signed by the governor, the state would be the first to ban bump stocks since the deadliest mass shooting in modern U.S. history.

Investigators say the gunman who opened fire Oct. 1 on a Las Vegas music festival, killing 58 people and wounding hundreds more, used the device that allows a semi-automatic firearm to mimic a fully automatic one.

The House and Senate approved an $85 million budget bill Thursday that includes the ban. Republican Gov. Charlie Baker supports a ban.

Lawmakers initially were considering banning any device that attaches to a rifle or shotgun to increase the discharge rate, which gun rights advocates opposed.

They adopted narrower language specifically prohibiting bump stocks and trigger cranks.