President Trump on Monday boasted that he would have run unarmed into a Florida high school to confront the gunman who used an AR-15 assault rifle to massacre 14 students and three staffers.

“You don’t know until you’re tested, but I think I really believe I’d run in there even if I didn’t have a weapon,” Trump told a gathering of the nation’s governors at the White House.

“I think the rest of you in this room would have done that, too, because I know most of you,” he said.

White House press secretary Sarah Huckabee Sanders said later the president was showing leadership.

“He was just stating that as a leader he would have stepped in and hopefully been able to help,” she said.

Trump also continued to hammer several Broward County sheriff’s deputies who remained outside when ex-student Nikolas Cruz, 19, allegedly carried out the Valentine’s Day rampage at Marjory Stoneman Douglas HS in Parkland.

“The way they performed was a disgrace,” he said.

He added that the deputies “weren’t exactly Medal of Honor winners.”

“The way they performed was frankly disgusting,” he said.

Trump also praised the National Rifle Association, and again pledged to take executive action to ban the sales of bump stocks, devices that can make semi-automatic rifles fire nearly as rapidly as machine guns.

“Don’t worry about the NRA — they’re on our side,” he said.

But he conceded that “sometimes” it would be necessary to take on the powerful gun group.

Trump said he is prepared to act unilaterally to get bump stocks off the market.

“By the way, bump stocks, we’re writing that out. I’m writing that out myself. I don’t care if Congress does it or not, I’m writing it out myself,” he said.

“You put it into the machine-gun category, which is what it is. It becomes essentially a machine gun, and it’s going to be very hard to get them, so we’re writing out bump stocks.”

He again backed allowing qualified teachers and other school personnel to carry concealed weapons in the classroom — an idea Democrats and many Republicans oppose, including Florida Gov. Rick Scott, who was at the White House gathering.

Washington Gov. Jay Inslee, a Democrat, also threw shade on the president’s idea.

“I’ve listened to the first-grade teachers that don’t want to be pistol-packing first-grade teachers. I just suggest we need a little less tweeting here and a little more listening,” Inslee told Trump.

But the president remained adamant, saying, “I want highly trained people that have a natural talent, like hitting a baseball, or hitting a golf ball, or putting.”

And, while professing his support for the Second Amendment and the NRA, he said that gun-safety laws, including tougher background checks are needed to prevent mass shootings.

Trump also repeated his call to reopen hospitals for people with mental illness who could be dangerous.

“You used to be able to bring them into a mental institution and hopefully he gets help or whatever. But he’s off the streets. You can’t arrest him, I guess, because he hasn’t done anything, but you know he’s like a boiler ready to explode, right?” he said.

“We’re going to have to start talking about mental institutions.”