Donald Trump said he would be working with lawmakers on gun legislation when Congress returns this month.

As the United States grappled with yet another mass shooting event on Sunday, President Donald Trump said that background checks on gun purchasers would not have prevented recent gun violence in the country.

A gunman near Odessa, Texas, killed seven and wounded 21 more after fleeing a traffic stop on Saturday. His motives remain unclear.

Trump made the remarks to reporters at the White House after returning to Washington from Camp David. The president said he would be working with Democrats and Republicans on gun legislation when Congress returns this month.

"I think Congress has got a lot of thinking to do frankly. They've been doing a lot of work," Trump said. "I think you're going to see some interesting things coming along."

Later, as Trump attended a briefing at the Federal Emergency Management Agency on Hurricane Dorian, he said he is committed to finding ways to "substantially reduce" the frequency of mass shootings by keeping firearms out of the hands of dangerous people, imposing harsher penalties for gun-related offenses, and expanding mental-health services.

Earlier this year, the Democratic-controlled U.S. House of Representatives passed a bill that calls for background checks on every gun purchase, including sales at gun shows, which are currently exempted. But the measure has failed to receive a vote in the Republican-controlled Senate.

Trump said at the White House that "for the most part, as strong as you make your background checks, they would not have stopped any of it."

Last month, a gunman killed 22 people and wounded another 24 in El Paso, Texas, while another assailant killed nine and injured 27 in Dayton, Ohio.

The shooter in Saturday's incident opened fire during a traffic stop near the town of Midland, Texas, and then sped off, spraying bullets at pedestrians and motorists. At one point, he ditched his car and hijacked a postal truck.

The gunman, who remains unidentified, was killed by police in a movie theater parking lot in Odessa.

Trump called him "a very sick person."

After the El Paso and Dayton shootings, Trump initially indicated a willingness to support more stringent background checks on gun buyers, but has since seemed to more closely align himself with the gun lobby, which opposes any increased restrictions.

Julian Castro, the former U.S. housing secretary and Democratic presidential candidate, said on Sunday that Trump "had gone back on his word" regarding background check legislation. Castro, who made the remarks on NBC's "Meet the Press," is a former mayor of San Antonio, Texas.

Trump has suggested that he would support efforts to encourage states to adopt "red flag" laws, which give family members and police the power to obtain a court order from a judge to confiscate firearms from someone deemed a danger to themselves or others.

Texas Governor Greg Abbott, a Republican, told reporters in Texas on Sunday that he would continue to work to end gun violence and that the latest incident required new approaches.

"We need solutions that will keep guns out of the hands of criminals, like the killer here in Odessa, while also ensuring that we safeguard Second Amendment rights. And we must do it fast," Abbott said.

New laws passed by the state legislature that eased restrictions on guns took effect in Texas on Sunday, including those that allow firearms in churches and more armed marshals in schools.