President Donald Trump, joined by first lady Melania Trump, gestures after making a statement on the El Paso and Dayton, Ohio, mass shootings, as they prepare to board Air Force One on Sunday.

WASHINGTON — President Donald Trump on Monday called for Republicans and Democrats to work together to strengthen background checks for prospective gun buyers and proposed “marrying” new measures with new immigration laws — two of the most politically divisive issues facing lawmakers.

Trump’s comments, made in early morning Twitter posts, come as the country mourns two deadly mass shootings over the weekend in Texas and Ohio that killed 29 people.

The president is scheduled to speak later Monday morning. He has condemned the shootings but has not addressed a manifesto that authorities said was written by the gunman in El Paso; the manifesto echoes Trump’s language on immigration.

In another Twitter post Monday, the president railed against the news media, blaming it for the contributing to “the anger and rage” in the United States.

Law enforcement officials arrested Patrick Crusius, a 21-year-old white man from Allen, Texas, which is about a 10-hour drive from the Walmart in El Paso where he opened fire on Saturday and killed 20 people.

Early Sunday in Dayton, Ohio, police killed the gunman within one minute of hearing shots fired into a popular nightlife spot in the city. The gunman, Connor Betts, 24, was wearing a mask, body armor and hearing protection and was carrying a high-capacity magazine that can hold 100 rounds of ammunition. Nine people were killed, including Betts’ sister.

It was not immediately clear what kind of changes to the background checks Trump was referring to in his tweet.

Congress has been gripped by inaction on gun violence for years, and with Democrats running the House and Republicans in charge of the Senate, that is unlikely to change soon.

The House took back-to-back action on gun control earlier this year. It voted in February to require background checks for all gun purchasers, including those at gun shows and on the internet — the first significant gun control bill to clear the chamber in a quarter century.

The following day, the House voted to close the so-called “Charleston loophole,” a gap in the background check system that allowed a man to buy the gun used to kill nine members of a church in Charleston, South Carolina.

But the Senate has refused to take up the bills.

Over the weekend, members of both parties retreated to their familiar stances. Republicans issued statements praising law enforcement and raising concerns about mental health issues, and Democrats called for the Senate to return to pass the House bills. Lawmakers in both parties have left Washington for their August recess and do not plan to return to the Capitol until September.

“This is a time that demands not words but actions,” Rep. David Cicilline, D-R.I., a member of House Democratic leadership, said in a statement, in which he called not only for the Senate to return but the House as well, so that it could consider an assault weapons ban, which he introduced earlier this year.

Rep. Steve Scalise, R-La., the No. 2 Republican in the House, is still recovering from gunshot wounds he sustained in 2017 when a gunman opened fire during practice for a congressional baseball game. Scalise said the weekend shootings should be called “domestic terrorism,” but he also blamed the media, saying that “a media culture that encourages viewing people solely through hyperpartisan lenses,” can “often lead to violent consequences.”

Sen. Susan Collins of Maine, one of a handful of Republican centrists in the Senate, already faced a tough reelection race should she choose to run again. On Monday, she issued a carefully worded statement that sidestepped the question of whether she would back gun control measures, saying, “We have united in the wake of tragedies in the past, and we can do so again to stop this violence.”

Sen. Mitch McConnell of Kentucky, the Republican leader, praised law enforcement officers for their quick response to the shootings but did not mentioned gun safety legislation.

Some of the Democrats campaigning for the party’s nomination to run for president condemned Trump for not calling the El Paso attack a white supremacist act of domestic terrorism. Some Democrats blame the Trump White House for what appears to be a tolerance for white nationalist groups, something that was not common among Trump’s recent predecessors.

Still, no federal agency is responsible for designating domestic terrorism organizations, and there is no criminal charge of domestic terrorism. Suspects who are considered domestic terrorists are charged under other laws, such as hate crime, gun and conspiracy statutes.