WASHINGTON—The U.S. Justice Department has submitted a regulation to ban devices that allow certain firearms to fire as rapidly as machine guns, making so-called bump stocks illegal to own or sell.

The proposed ban represents the first action from the executive branch on guns since President Donald Trump said last year that he wanted to make school safety the White House’s priority.