President Trump said Friday that “serious discussions are taking place” among congressional leaders about background checks to keep firearms out of the hands of “mentally ill or deranged people” — though he insisted that the views of the National Rifle Association should be taken into account.

“Serious discussions are taking place between House and Senate leadership on meaningful Background Checks,” the president said on Twitter.

“I have also been speaking to the NRA, and others, so that their very strong views can be fully represented and respected. Guns should not be placed in the hands of mentally ill or deranged people,” he continued.

“I am the biggest Second Amendment person there is, but we all must work together for the good and safety of our Country. Common sense things can be done that are good for everyone!” the president added.

Trump later told reporters at the White House that he was looking for “very meaningful background checks” but was not considering a resurrection of an assault weapons ban. He said he also believes lawmakers will support “red flag” laws that allow guns to be removed from those who may be a danger to themselves and others.

“I see a better feeling right now toward getting something meaningful done,” Trump said when asked why the political environment was different now. “I have a greater influence now over the Senate and the House.”

Trump said he had spoken with congressional leaders from both parties and asserted that Senate Majority Leader Mitch McConnell is “totally on board” with his plans to keep “sick and demented people” from buying firearms.

“The Republicans are going to be great and lead the charge along with the Democrats,” he said.

In response, a McConnell spokesman said he had not yet endorsed any legislation, according to The Washington Post.

Speaking to reporters, the president said the NRA strongly supported him during the 2016 election and that he hoped the group can be persuaded of the wisdom of “very meaningful background checks.”

“I think in the end . . . the NRA will either be there or will be a little more neutral, and that’s OK, too,” said Trump, who referred to NRA members as “great patriots,” adding that he had spoken with the gun lobby’s chief executive Wayne LaPierre this week.

Trump acknowledged that there have been previous efforts to strengthen background checks “that went nowhere,” but, he added, “There’s never been a president like President Trump.”

His comments come a day after McConnell said he wants to consider background checks and other bills in the wake of two mass shootings in El Paso, Texas, and Dayton, Ohio, that claimed 31 lives.

The GOP leader won’t be calling senators back to work early, as some are demanding, but he told a Kentucky radio station that the president called him Thursday morning and they talked about several ideas.

The president, he said, is “anxious to get an outcome, and so am I.”

“What we can’t do is fail to pass something,” McConnell said. “What I want to see here is an outcome.”

McConnell said he and the president discussed several ideas, including background checks and the so-called “red flag” laws that allow authorities to seize firearms from anyone considered a threat to themselves or others.

“Background checks and red flags will probably lead the discussion,” McConnell told Louisville’s WHAS-AM.

He noted “there’s a lot of support” publicly for background checks. “Those are two items that for sure will be front and center as we see what we can come together on and pass.”

Republicans have long opposed expanding background checks, and a bill passed by the Democrat-led House has stalled in the Senate.

House Speaker Nancy Pelosi and Senate Minority Leader Chuck Schumer said the president assured them Thursday that he would review the House-passed bill that expands federal background checks for firearm sales.

With Post wires