A bump stock attached to a semiautomatic rifle. (Rick Bowmer/AP)

As thousands of students across the country walked out of classes Wednesday to protest gun violence, the Maryland House of Delegates moved a step closer to banning bump stocks, devices used to accelerate the firing of semiautomatic weapons.

The bill was one of three key measures aimed at addressing gun violence that advanced in the General Assembly. The others would help take weapons out of the hands of domestic violence offenders and people dealing with mental illness.

The legislation to ban bump stocks would prohibit the manufacture, sale, possession and use of those and other rapid-trigger devices, bill sponsor Del. David Moon (D-Montgomery) said. The measure was introduced in response to the mass shooting in Las Vegas last year that left 58 people dead and hundreds injured.

“The Las Vegas mass shooting exposed a pretty glaring loophole in Maryland gun laws,” he said. “We found you can circumvent the purpose of the assault weapons ban by putting the device on your gun.”

The legislation received preliminary approval in the House just days before crossover on March 16, the day when legislation must pass out of at least one chamber to have a reasonable chance of reaching the governor’s desk. It has not been considered in the Senate.

Under the measure, a person who violates the ban would be subject to three years in prison and a fine of $5,000.

Moon said he was surprised to hear one of his colleagues say during the floor debate that he owned a bump stock. Del. Seth A. Howard (R-Anne Arundel) pushed for an amendment that would ban only future sales of bump stocks, arguing that thousands of Marylanders who own the devices — including him — could otherwise be subject to penalty.

“I wasn’t quite expecting that,” Moon said. “I heard him say he had a bump stock but not why he needed it. . . . And that’s really at the heart of it. No one has given a legitimate argument for the use of these devices.”

The other measures include one that would require domestic violence offenders to surrender their guns and another that would allow family members or law enforcement agencies to seek court orders to keep people who have been deemed by a judge to be a danger to themselves or others from owning a gun. Those measures have bipartisan support.

The Senate unanimously approved the bill dealing with domestic violence offenders, while the House gave initial approval to a similar bill and to the legislation affecting people who may be mentally ill or a danger to themselves.

Gov. Larry Hogan (R) said last month that he supports both measures.

Gun-control advocates have pushed for the domestic-offender bill for three years.

Sen. William C. Smith Jr. (D-Montgomery), sponsor of the domestic-violence-related bill, said it appears to have gained momentum after the recent death of a Prince George’s County police officer who was trying to help a neighbor involved in a domestic violence situation.

Court Watch Montgomery, a nonprofit organization that monitors Montgomery County courts, conducted a study three years ago and found that judges in Montgomery County District Courts told only one out of 126 convicted domestic violence offenders that they were banned from owning or buying guns.