WASHINGTON — President Donald Trump has been in talks with key members of the Senate on potential gun control legislation in the wake of mass shootings that left more than 30 dead this month.

Among the senators with whom Trump has been discussing a proposed bill, according to a senior administration official, are Chris Murphy, D-Conn., one of the Senate’s leading gun control advocates, along with Pat Toomey, R-Pa., and Joe Manchin, D-W.Va., two authors of a 2013 background checks bill that failed to pass in the wake of the Sandy Hook Elementary School shooting.

White House and Senate aides have also been meeting to discuss the issue, marking the most substantive talks the Trump administration has had to date on gun control policy. The meetings were first reported by The New York Times.

Trump said last week that he had “tremendous support” for possible new measures to tighten background checks on gun buyers, claiming that even Senate Majority Leader Mitch McConnell, R-Ky., a traditional opponent of such laws, was backing the effort.

“I spoke to Mitch McConnell yesterday. He's totally on board. He said, ‘I've been waiting for your call,’” Trump told reporters Aug. 9 before leaving the White House for his summer retreat in Bedminster, New Jersey. “I spoke to senators that in some cases, friends of mine, but pretty hard-line senators ... hard-line on the Second Amendment.”

“And they understand, we don't want insane people, mentally ill people, bad people, dangerous people, we don't want guns in the hands of the wrong people,” Trump said.

After the February 2018 shooting at Marjory Stoneman Douglas High School in Parkland, Florida, that left 17 students and teachers dead, the president at first indicated he could support tightening background checks for gun buyers, but backed away and instead threw his support behind a proposal to arm and train some teachers on how to use firearms and called for institutionalizing mentally ill people believed to be capable of violence. Trump has also moved to ban bump stocks, devices that allow semi-automatic rifles to fire continuously like machine guns.

In February, the Democratic-controlled House passed two bills that would have tightened background checks on gun buyers, but the GOP-controlled Senate never took up either of the bills, and Trump had promised to veto the legislation.

The president, his daughter Ivanka Trump and senior White House officials began conversations last week with key senators about what legislative action could be taken on gun control, and this week conversations began at the staff level to begin hammering out the details.

On background checks, the White House is looking to model a bill after the Toomey-Manchin legislation that failed following the Sandy Hook shooting in 2012, according to a senior administration official. Even though the bill wasn’t successful, the White House says it believes it has a good policy framework and bipartisan support.

The White House isn’t considering asking Congress to pass a federal "red flag" law, according to the official, but rather talking about working with lawmakers to assemble a framework for states to follow if they choose to put in place their own such laws.

The White House is also working with Sen. Lindsay Graham, R-S.C., who heads the Judiciary Committee, on potential changes to the federal death penalty statute.

Staffers for Sen. Lamar Alexander, R-Tenn., chairman of the Senate Health, Education, Labor and Pensions Committee, were also present for a White House meeting on the issue Tuesday, his spokesman Taylor Haulsee told NBC News on Wednesday. Alexander is among the chairmen McConnell tasked with coming up with legislative solutions to address gun violence.

"I am writing to ask for your recommendations on bipartisan proposals within the HELP committee’s jurisdiction that could help prevent future mass shootings like the recent tragedies in California, Texas, and Ohio," Alexander wrote in a letter obtained by NBC to his committee members on Friday.

Alexander said that he has asked his committee staff "to evaluate existing mental health and school safety programs, including current appropriated funding levels for these programs, and to examine bills that have been introduced within the Committee’s jurisdiction so we may begin to look for bipartisan proposals to provide possible solutions to this crisis."

In addition, the White House has been reaching out to members of Congress to discuss actions that could be taken on mental health and violence in video games and entertainment, though no specific legislation is being proposed on either front yet.

McConnell, who has been resistant to take up gun control legislation, has been involved with the White House in the process. Trump has been hearing criticism from advisers and allies over the political and policy risks that exploring new gun legislation could bring, according to the official, but is so far unmoved.

CORRECTION (Aug. 14, 2019, 11:05 a.m. ET) An earlier version of this article misstated that Sen. Lamar Alexander, R-Tenn., was at a meeting Tuesday at the White House on gun violence. Alexander was not present at the meeting; his staffers were.