President Donald Trump hosted a bipartisan group of 17 lawmakers at the White House on Wednesday for a discussion on guns.

It was a freewheeling and open, with members of both parties passionately speaking about gun-control measures.

Trump chastised fellow Republicans for being "afraid of" the National Rifle Association.

President Donald Trump held a freewheeling White House meeting on Wednesday to discuss various gun-control measures, at one point jabbing a Republican senator over his reluctance to support raising the minimum age to purchase a gun to 21 from 18.

"I think you're afraid of the NRA," Trump told Sen. Pat Toomey of Pennsylvania, arguing that raising the age limit — something the National Rifle Association opposes — was "something we have to think about."

"A lot of people are afraid to bring it up," Trump said. Some Democrats, including Sen. Amy Klobuchar of Minnesota, smiled and nodded at Trump's remarks.

Toomey said his reservations stemmed from fears that such a regulation would punish the "vast majority" of 19- and 20-year-olds in his state who own rifles or shotguns and are "law-abiding citizens."

Trump said he had lunch with NRA leaders on Sunday, adding that they "have great power" over Republicans but "less power over me."

One particularly eye-opening comment came during a discussion of the availability of firearms to people with mental illness.

"I like taking the guns early," Trump said, adding, "Take the guns first, go through due process second."

The unusual meeting, which was open to the media and broadcast live, came two weeks after a gunman killed 17 people at a Florida high school. Authorities have said the AR-15 semiautomatic rifle used in the shooting was purchased legally.

Trump held a similar meeting on immigration in January, during which he reneged on several of his proposals on the issue; congressional negotiations collapsed weeks later.

'I don't want mentally ill people to be having guns'

Police escorting students out of Marjory Stoneman Douglas High School in Parkland, Florida, where a gunman killed 17 people on February 14. Joe Raedle/Getty Images In Wednesday's meeting, Trump made clear to the lawmakers that all options for gun control and school-safety measures were up for discussion.

He said at the outset that he was "going to write" an order banning bump stocks, devices that accelerate the rate of fire of a semiautomatic rifle and that the gunman who killed 58 people in Las Vegas last year last year used.

Trump also doubled down on his proposal to arm some teachers with concealed weapons in an effort to prevent school shootings, though he conceded that many disagreed.

Trump emphatically backed proposals to prevent people with mental illness from buying or owning guns — a popular Republican position.

"No. 1, you can take the guns away from people you can judge easily are mentally ill," he said.

"You have to have very strong provisions for the ill," Trump added. "I don't want mentally ill people to be having guns."

Trump appeared to be referring to so-called red flag laws that have recently gained some traction among lawmakers of both parties. Five states have such laws, which allow people to request that police confiscate weapons belonging to family members or those close to them who may pose a threat to themselves or others.

Many have pointed out that the suspect in the Florida shooting still possessed guns despite numerous run-ins with law enforcement, at least two calls to a tip line from people who said they feared he would shoot up a school, and a report from a Florida agency describing him as a "vulnerable adult due to mental illness."

But Republican Sen. Chuck Grassley of Iowa pushed back on Trump's emphasis on mental health, arguing that there are many people with mental illness "who are not a danger to others."

"It's not fair to other people that have mental illness," Grassley said. "We have to have a culture in our schools where people are attuned to people who have problems."

'Maybe you could all get together?'

A memorial outside the high school. Reuters/Mary Beth Koeth Democrats in the meeting appeared heartened by some of Trump's proposals, with Sen. Chris Murphy of Connecticut telling Trump that bills with the president's support could most likely pass the Senate.

"Mr. President, it's going to have to be you that brings Republicans to the table on this, because right now the gun lobby will stop it in its tracks," Murphy said. "The reason that nothing's gotten done here is because the gun lobby has had a veto power over any legislation that comes before Congress."

Trump ended the meeting by encouraging four senators, Democrats Murphy and Joe Manchin and Republicans Toomey and John Cornyn, to work on a bill that would address several of the proposals discussed.

"Chris and John, Pat, Joe — maybe you could all get together? You'll start it?" Trump said, adding that he thought it was "going to be a very successful bill, and I will sign it."

"But you have to be very, very powerful on background checks," he continued. "Don't be shy. Very strong on mentally ill."