President Trump leaned forward and listened intently for nearly an hour Wednesday afternoon as students, parents and teachers begged him to do something, anything, to prevent a mass shooting from happening at another school.

The group offered a wide variety of suggestions — bolster school security, drill students on what to do during a shooting and raise the age at which someone can buy an assault rifle — but in the end, the president remained focused on the solution he often proposes after a mass shooting: increasing the number of people with guns so they can quickly stop shooters with lethal force.

“If the coach had a firearm in his locker, when he ran at this guy — that coach was very brave, saved a lot of lives, I suspect — but if he had a firearm, he wouldn’t have had to run,” Trump said, referring to Aaron Feis, an assistant football coach and security guard who was one of 17 people killed by a gunman last week at Marjory Stoneman Douglas High School in South Florida. “He would have shot, and that would have been the end of it.”

The 70-minute listening session with students, parents and teachers at the White House was a remarkable event with participants’ raw emotions often on display — at one point, a student openly sobbed after he spoke, his head down as he wiped away tears and those around him rubbed his back.

By hosting the event, Trump signaled he wants to take ownership of addressing the vexing problem of gun violence at American schools. As one parent after another, one student after another, publicly pleaded with Trump to find a solution, the pressure mounted on the president to show that he can move Washington to act on an issue it has failed to confront despite the frequency of mass shootings in recent years.

“We’re going to do something about this horrible situation that’s going on,” Trump said. “And we’re going to all figure it out together.”

Students from Marjory Stoneman Douglas High School in Parkland, Fla., traveled to their state capital on Feb. 20 to ask lawmakers for gun reform. (Alice Li, Whitney Shefte, Michael Landsberg/The Washington Post)

But it will be a difficult promise to fulfill with Trump’s Republican Party long opposed to making it more difficult to buy a gun and Democrats and gun-control advocates calling anything short of limiting access to firearms a failure. It will require him to use the bipartisan dealmaking skills he promised to bring to his presidency but has yet to show.

The event at the White House, held a week after 19-year-old Nikolas Cruz allegedly opened fire at his former high school, was part of the administration’s effort to show it is determined to listen and then act.

Vice President Pence urged participants to be open, candid and vulnerable — an unusual request on behalf of a president who has tried to minimize his exposure to people who don’t agree with him.

Trump sat quietly for most of the event, often nodding his head as if in agreement. He held notes that told him to ask the participants about their experiences and what the White House could do, along with a reminder to say, “I hear you.”

Trump heard from students who attend Marjory Stoneman Douglas High School and parents-turned-activists whose children were killed in shootings in Colorado in 1999 and Connecticut in 2012. He also heard from teachers and students at public charter schools in Southeast Washington that have instituted airport-like security checkpoints at their buildings.

Missing from the listening session were the teenage survivors of last week’s mass shooting who have become outspoken leaders of a movement focused on banning assault rifles such as the one allegedly used by the gunman. Those students were in Florida on Wednesday to lobby state lawmakers in Tallahassee and participate in a town hall event hosted by CNN in South Florida.

David Hogg, a survivor of the shooting who has passionately argued for stricter gun control measures, declined an invitation extended by the White House, according to his mother, Rebecca Boldrick.

“He needed to be in Tallahassee today,” she said in a telephone interview. Boldrick said that Hogg told the White House that if Trump wants to talk to the students, he has to come to Parkland, Fla.

At the White House, Trump sat in a circle with many of the participants and asked them to share their stories and suggestions for making schools safer from gun violence.

Carson Abt, a Parkland student, said all public schools need to regularly do drills to prepare for a potential mass shooting. Cary Gruber, who texted with his son during the Parkland shooting, said he doesn’t understand why teenagers who are too young to buy a beer can purchase an assault rifle.

“In Israel, you have to be 27 years old to have a gun,” said Gruber, whose son survived the shooting. “You’re only allowed one. They tax the guns. You have to go through significant training. We got to do something about this. We cannot have our children die. This is just heartbreaking. Please.”

Samuel Zeif, the student who sobbed after speaking, said he doesn’t understand why teenagers like him can “go in a store and buy a weapon of war, an AR.”

On Wednesday, an NRA spokeswoman said the group would oppose putting age restrictions on firearms, saying that it would punish “law-abiding citizens for the evil acts of criminals.”

Parkland Mayor Christine Hunschofsky read aloud messages for the president from the parents of two high school students killed last week. One of the fathers, an airline pilot, said he supports the Second Amendment but not ownership of assault rifles. Another parent urged the president to “publicly acknowledge the role of guns” in these shootings.

Andrew Pollack, whose daughter was killed last week, said that it made him angry to visit the Education Department on Wednesday and see armed security guards everywhere, even in the elevator. He said this is not a gun issue and is instead a matter of better securing and guarding schools.

“Fix it,” said Pollack, who was wearing a red “Trump 2020” T-shirt as he searched for his daughter last week. “It should have been one school shooting, and we should have fixed it. And I’m pissed, because my daughter, I’m not going to see again. She’s not here. She’s not here. She’s at — in North Lauderdale, at whatever it is — King David Cemetery. That’s where I go to see my kid now.”

After all of these ideas had been shared, Trump again asked the group whether they could suggest some solutions, prompting one father to call for arming teachers, custodians and librarians. A mother suggested that government agencies need to better communicate about students who are struggling with mental-health problems.

Then, it was the president’s turn to speak.

He reflected on how many mental hospitals and institutions have been shut down over the years, adding that the alleged shooter in Parkland was “a sick guy, and he should have been nabbed a number of times.” He mentioned how first responders often cannot get to schools quickly enough when a shooting begins, and he endorsed the idea of arming teachers and other school employees. He said that gun-free zones like those at schools attract maniacs who want to harm others — a reversal from the campaign when he said that he didn’t “want guns brought into the school classroom.”

Trump promised that “we’ll be doing the background checks” for those looking to purchase guns. He said “a lot” of airline pilots now carry guns — a questionable assertion — making the skies safer. He then polled the group to see how many supported the idea of arming teachers.

Some of the participants tried to make their cases again. Nicole Hockley, whose son was killed at Sandy Hook Elementary School in 2012, told the president that although troubled students who carry out mass shootings often are not mentally well, they are usually not at the point of needing to be institutionalized. She urged everyone to focus on preventing shootings, not just lessening the death toll when they happen. Zeif said that assault rifles “are not weapons of defense, these are weapons of war.” A parent who lost a child at Sandy Hook Elementary School, Mark Barden, said his wife is a teacher and does not want her job to include using “lethal force to take a life.”

“Nobody wants to see a shootout in a school,” he said, as some in the room applauded.

Barden said that he and other activists have come up with ways to train teachers and students to intervene before a shooting happens.

“We have a solution right here,” Barden said. “We’re asking for you to please help.”

Trump broadly promised that he would.

“It’s very difficult, it’s very complex, but we’re going to find the solution,” he said. “There are many different ideas. Some, I guess, are good. Some aren’t good. Some are very stringent, as you understand, and a lot of people think they work, and some are less so.

Mark Berman and Faiz Siddiqui contributed to this report.