Lawmakers and other officials offered starkly different responses to a massacre in Texas this week and a separate tragedy in New York City that occurred only one week ago.

On Sunday, a lone gunman opened fire on rows of parishioners inside the First Baptist Church in Sutherland Springs, Texas, killing 26 people and injuring 20 more. Officials identified the suspect as 26-year-old Devin Patrick Kelley, a white U.S. citizen with a history of domestic violence. Not much is known about Kelley’s motives, but he is believed to have quarreled with his wife’s parents, who attended the church, although they were not present this Sunday (his wife’s grandmother, Lula Woicinski White, was reportedly among the victims). Kelley’s victims ranged in age from 18 months old to 72 years old; around half of those killed were children.

Following the tragedy, officials condemned the shooting — the deadliest in modern Texas history — while offering vague condolences.

“Our thoughts and prayers are with the victims and families of today’s murderous attack in Sutherland Springs, Texas,” a White House statement read. “This horrible act of evil occurred as the victims and their families were in their place of sacred worship. We cannot put into words the pain and grief we all feel, and we cannot begin to imagine the suffering of those who lost the ones they loved. Our hearts are broken.”

President Donald Trump also commented on the incident separately, claiming that the tragedy was “not a guns situation” and speaking to the attacker’s individual struggles.

“I think that mental health is your problem here,” Trump said. “Based on preliminary reports, a very deranged individual, a lot of problems for a long period of time.” The president went on to argue that the presence of additional firearms inside the church helped the situation.

“Fortunately, somebody else had a gun that was shooting in the opposite direction,” he said, referring to a neighbor who ultimately shot the gunman, causing the suspect to flee in his truck.

Texas Attorney General Ken Paxton offered similar comments on Monday.

“All I can say is, you know, in Texas at least we have the opportunity to have concealed-carry. So if it’s a place where somebody has the ability to carry, there’s always the opportunity that gunman will be taken out before he has the opportunity to kill very many people,” Paxton said.

“You know, it is an unfortunate thing that the first place the media goes after any murder is politicizing it,” said Texas Sen. Ted Cruz (R) on Monday. “We don’t need politics right now.”

Those comments come less than a week after a separate attack in New York, in which 29-year-old Sayfullo Saipov, an immigrant from Uzbekistan, allegedly drove a truck into people on a bicycle lane in Manhattan, killing eight. Saipov’s actions were immediately labeled an act of extremism.

Whereas many lawmakers declined to push for a hardline policy response after the Texas massacre on Sunday, few were so restrained following the attack in Manhattan last week.

While officials have said Saipov became interested in militancy only after coming to the United States, Trump and a number of lawmakers have since used the attack as an excuse to hone in on the Diversity Immigrant Visa Program, a bipartisan effort created in 1990 under which Saipov was able to immigrate. Many have also used the incident to call for harsher immigration measures and restrictions.

“I have just ordered Homeland Security to step up our already Extreme Vetting Program,” Trump tweeted last Wednesday, the day after the attack. “Being politically correct is fine, but not for this! The terrorist came into our country through what is called the ‘Diversity Visa Lottery Program.”

Later that afternoon, Trump doubled down, telling reporters, “We need to get rid of the lottery program as soon as possible.”

The president went further as the week went on, at one point calling for Saipov to receive the death penalty while suggesting that the suspected attacker could be sent to Guantánamo Bay.

“There is also something appropriate about keeping him in the home of the horrible crime he committed,” Trump wrote. “Should move fast. DEATH PENALTY!”

Trump wasn’t alone in calling for extreme measures in the immediate aftermath of the Manhattan attack. Republican Sens. Lindsay Graham (SC) and John McCain (AZ) called for Saipov to be held as an enemy combatant under the Law of War. On Twitter, Rep. Don DeSantis (R-FL) also called for authorities to look into the suspect’s background.

“Terrorist attack in NYC. Shouting of ‘Allahu Akbar’ by terrorist. Need to figure out his background and whether he has ties to ISIS,” he wrote.

Terrorist attack in NYC. Shouting of “Allahu Akbar” by terrorist. Need to figure out his background and whether he has ties to ISIS.

Lawmakers on both sides of the aisle offered immediate support for hardline measures after the attack. When asked whether he would support an end to diversity visas, Sen. Dick Durbin (D-IL) said his party would be supportive.

“Of course we would,” he said, indicating that legislative steps to end the program could go hand-in-hand with broader immigration reform.

The wildly different responses to the two attacks in New York and Texas are likely due to a number of factors. A study published last spring found that attacks carried out by Muslims received 449 percent more coverage than attacks perpetrated by non-Muslims. That likely explains the immediate, visceral response to the New York attack and why so many lawmakers were eager to voice their hardline opinions on the matter so quickly to an already eager press.

Using that same research, it can be argued that the staggering number of people killed in the Texas attack might also be the primary reason lawmakers are commenting on the incident at all — if the death toll had been lower in Texas (perhaps closer to the eight that were killed in New York), research indicates that it likely would have received far less coverage and evoked a far less immediate response.

Another possible reason for the disparity between reactions: Blaming extremism is also politically beneficial in the United States. Pushing for gun control, by contrast, is less appealing, especially given that the National Rifle Association (NRA) and the wider gun lobby represent an incredibly powerful force Capitol Hill. OpenSecrets, which tracks political donations, notes that the NRA doled out approximately $838,215 to various political figures in 2016 alone. According to a New York Times infographic, many Republicans on the Hill have received millions from the NRA over the course of their political careers.

President Trump’s varied responses to national tragedies are nothing new, of course — in fact, emphasizing nationality and religion when the attacker is Muslim and highlighting mental health when the attacker is a white male U.S. citizen is a recurring theme for Trump.

“Another attack in London by a loser terrorist,” Trump tweeted in the aftermath of an attack in London two months ago. “These are sick and demented people who were in the sights of Scotland Yard. Must be proactive!”

“The travel ban into the United States should be far larger, tougher and more specific-but stupidly, that would not be politically correct!” he added.

At the time, authorities had stated that their investigation was ongoing and had not released details on the suspected attacker.