Sen. Lindsey Graham said Monday he’s struck a bipartisan deal to write legislation that would encourage states to adopt “red flag” laws allowing guns to be taken from potentially dangerous individuals, and he vowed action in the wake of this weekend’s shootings.

The South Carolina Republican said his legislation, which he has worked on with Sen. Richard Blumenthal, Connecticut Democrat, would offer grants to law enforcement to hire professionals to try to decide cases where guns should be taken from troubled individuals.

Mr. Graham said he talked to President Trump about the idea earlier Monday, and the president “seems very supportive.”

“Many of these shootings involved individuals who showed signs of violent behavior that are either ignored or not followed up. State Red Flag laws will provide the tools for law enforcement to do something about many of these situations before it’s too late,” said Mr. Graham, the chairman of the Senate Judiciary Committee.

Red flag laws have been pioneered in some states such as Florida, scene of the 2018 Valentine’s Day school shooting in Parkland.

Under a red flag law, potentially dangerous individuals can be reported by family or others, and local officials then determine whether there is cause to temporarily remove firearms the person may have. Cases where weapons were removed in Florida involved both risks to others or potential suicide cases.

Mr. Graham said he and Mr. Blumenthal will introduce national red flag grant legislation “in the very near future.”

Sen. Dianne Feinstein, the top Democrat on the Judiciary Committee, said there’s no need to wait.

She’s already written and introduced her own version, the Extreme Risk Protection Order Act,” that would create a grant program to encourage states to come up with red flag laws. She said Mr. Graham could put her bill on the committee’s agenda.

“The Senate could vote on that bill today,” she said.

She said that while 15 states and the District of Columbia have red flag laws on the books, neither Texas nor Ohio — scenes of the weekend’s shootings — have one.

But she said the Senate needs to go further than that.

She called for Congress to renew the Assault Weapons Ban, a now-expired 1994 law that restricted the sale of some military-style semiautomatic rifles.

“It took the Dayton shooter less than 30 seconds to shoot 35 people, nine of whom died. This validates the theory that these weapons are designed to kill as many people as possible, as quickly as possible,” she said.