San Antonio police officers investigate the scene where multiple people were found dead in a tractor-trailer loaded with undocumented immigrants outside a Walmart store in stifling summer heat. (Eric Gay/AP)

The discovery of dozens of migrants in a dangerously overheated trailer in San Antonio this weekend has further inflamed the national debate over illegal immigration, particularly sanctuary cities that limit cooperation with federal authorities.

In a Facebook post late Sunday, Texas Lt. Gov. Dan Patrick (R) appeared to blame the tragedy on sanctuary policies like those adopted by San Antonio, San Francisco, Chicago and other jurisdictions, which he said “entice” people to illegally cross the border by creating the impression that local authorities will shield them from deportation.

He praised a Texas law — currently under court challenge — that would impose harsh penalties on jurisdictions that do not cooperate with federal immigration authorities.

Immigrant rights groups, in contrast, pointed the finger at increasingly harsh U.S. tactics toward undocumented immigrants, which they said drive would-be migrants to turn to unsafe methods to enter the United States.

They cited the Texas law, which will take effect Sept. 1 unless the lawsuit against it is successful, as an example of that worsening treatment.

Pedro Paredes joins hundreds of protesters at the state Capitol rotunda in Austin on May 29 to protest Texas immigration policy. (Ricardo Brazziell/AP)

Authorities say the tractor-trailer found in the parking lot of a San Antonio Walmart on Sunday was used to illegally transport more than 100 immigrants from Mexico as part of a smuggling operation.

There was little ventilation and no cooling in the cargo bay, creating punishing conditions as temperatures soared into the triple digits. Ten of the truck’s occupants have died, and dozens of others remain hospitalized, some in critical condition.

The incident comes at a time of stepped-up immigration enforcement by the Trump administration, which has made it a priority to deport those in the country illegally and pledged to dramatically increase border security.

In Texas, tensions also are rising over the anti-sanctuary-city law known as S.B. 4. The measure requires local authorities to hold and turn over undocumented immigrants who have been ordered detained by Immigration and Customs Enforcement. It carries harsh penalties, including fines and even jail time, for officials who refuse to comply.

Several cities and counties, including San Antonio, have sued to block the measure, arguing that it violates the U.S. Constitution. Critics of the law say cooperating closely with federal immigration authorities erodes public trust and often forces them to keep people in jail beyond their sentences.

Sen. John Cornyn (R-Tex.) suggested Sunday on Twitter that better border security would have forestalled this weekend’s human-smuggling episode.

“Compassion is called for,” he wrote. “But lawlessness ensures cartels will continue to profit from these tragedies. Status quo is not compassionate.”

A bottle of water, flowers, candles and stuffed animals form a makeshift memorial in the parking lot of the Walmart store after immigrants died in the back of a truck. (Eric Gay/AP)

In his Facebook statement, Patrick wrote, “Sanctuary cities entice people to believe they can come to America and Texas and live outside the law. Sanctuary cities also enable human smugglers and cartels. Today, these people paid a terrible price and demonstrate why we need a secure border and legal immigration reform so we can control who enters our country.”

The posting — which was shared more than 1,500 times — drew immediate rebukes from immigrant rights advocates, who argued that the anti-sanctuary-cities law would make such tragedies more common.

“We think that it is policies like S.B. 4 and the growing criminalization of immigrants and the growing militarization of our border that . . . pushes people into shadows, sometimes literally to the back of the truck to hide from authorities,” said Amy Fischer, policy director for the Refugee and Immigrant Center for Education and Legal Services.

In 2003, 19 people died in the trailer of an 18-wheeler during a 120-mile journey across the U.S.-Mexico border.

Two weeks ago, Houston police discovered 12 immigrants who had been locked in a sweltering box truck for hours and were seeking help by banging on the walls. And in May, border agents discovered 18 immigrants locked in a refrigerated produce truck, the temperature set at 51 degrees.

At a vigil for the victims Sunday night, Rep. Joaquin Castro (D-Tex.), said U.S. lawmakers should bear some of the blame for this and other smuggling disasters.

“This represents a symptom of a broken immigration system that Congress, of which I am a part, has had the chance to fix but has not,” Castro said. “That’s a colossal failure that has a human cost.”

Rey Saldaña, the San Antonio City Council member who represents the area where the truck was discovered, said it would be a mistake to conclude that people are drawn to the United States because of sanctuary policies. He said they come because of larger and more complex desires for a better life — pressures that have existed for decades.

“I would lay a lot of this on people who have ignored a system that has incentivized this one kind of entry,” Saldaña said. “And so people turn to the danger of human smugglers.”