The Massachusetts House approved a bill Wednesday that would outlaw devices that allow semi-automatic weapons to mimic fully automatic guns.

The House voted 151-3 in favor of legislation to ban so-called bump stocks, such as those used by the Las Vegas shooter.

Republican Gov. Charlie Baker has said he supports a ban.

The devices fit over the stock and grip of a semi-automatic rifle and allow the weapon to fire continuously.

State Rep. David Linsky, a Natick Democrat, filed legislation that would outlaw any devices that - when attached to a rifle, shotgun or firearm - increase the weapon's rate of discharge.

Those who violate the measure would face up to 20 years in prison. The prohibition would take effect 180 days after becoming law.

The Las Vegas shooter had 12 weapons fitted with such devices.

House Speaker Robert DeLeo defended the decision to vote on the bill without holding public hearings first, saying Massachusetts has a long history of taking action to prevent gun violence.

"I think it's important for us to take it up and take it up immediately," the Winthrop Democrat said before the vote.

Lawmakers in the Massachusetts Senate also have said they would support a ban. The Senate is scheduled to meet in a formal session on Thursday.

The amendment approved by the House says that anyone who "possesses, owns or offers for sale any device which attaches to a rifle, shotgun or firearm, except a magazine, that is designed to increase the rate of discharge of the rifle, shotgun or firearm or whoever modifies any rifle, shotgun or firearm with the intent to increase its rate of discharge, shall be punished by imprisonment in the state prison by not less than three nor more than 20 years."

Linsky's bill initially would have also eliminated a state law that allows magazines that hold more than 10 rounds of ammunition, if they were manufactured prior to 1994. That language was later dropped. Linsky said that could be discussed another time.

Jim Wallace, executive director of the Gun Owners Action League of Massachusetts, said the rush to ban the devices is premature.

The National Rifle Association, of which the Gun Owners Action League is an affiliate, has suggested that the Federal Bureau of Alcohol, Tobacco, Firearms and Explosives should revisit the devices and determine if they should be subject to greater restrictions.

"They don't even know what the ATF's going to do yet," Wallace said. "The investigation hasn't been finished. The ATF may take this up and may change everything. To rush something through like this without taking the time to figure out what's going on is kind of irresponsible."