America’s long-simmering debate on immigration collided with election year politics Wednesday as the Senate blocked bills pertaining to undocumented aliens who commit crimes in the United States.

Democrats banded together to defeat two Republican proposals as lawmakers looked ahead to their national party conventions later this month.

One bill would compel local jurisdictions to cooperate with federal authorities in identifying and handing over undocumented immigrants who are taken into custody. Another bill would set mandatory penalties for aliens who repeatedly return to the United States after being deported.

“We should come together and protect the American people,” said Republican Senator Ted Cruz, a former presidential candidate. “It is time to confront the sobering issue of illegal aliens.”

“Republicans are legislating [Republican presumptive presidential nominee] Donald Trump’s vision that immigrants and Latinos are criminals and threats to the public,” said Senate Minority Leader Harry Reid, a Nevada Democrat.

Near-unified Democratic opposition caused both bills to fall short of the three-fifths' backing required to advance.

The measures already had been blocked in the Senate last year, but majority Republicans revived them at the one-year anniversary of a grisly murder that focused national attention on violent crimes committed by some undocumented aliens.

Jim Steinle (2-L) father of Kathryn Steinle, in photograph, testifies at a Senate Judiciary hearing in Washington, July 21, 2015. Kathryn Steinle was killed in San Francisco, allegedly by a man previously deported several times.

Steinle murder

In July 2015, Kathryn Steinle was shot and killed in San Francisco, allegedly by an undocumented man who had several felony convictions and had been deported five times from the United States.

Weeks before the crime, the suspect was released from custody by San Francisco’s sheriff’s department, which ignored a request by federal immigration agents that the man be held for deportation.

Like many municipalities and counties across America, San Francisco is a so-called “sanctuary city” that does not flag undocumented immigrants to federal authorities.

“This is madness,” said Republican Senator Pat Toomey of Pennsylvania, whose bill would cut federal funds to sanctuary cities. “It’s unbelievable that we have municipalities that are willfully releasing dangerous people into our communities.”

“The sad truth is that Kate [Steinle] should be alive today,” the Texas Republican said. “But she isn’t because the federal government failed her.”

Democrats see election year politics at play, with Toomey waging a tough reelection campaign.

“Senator Toomey’s sanctuary cities bill… gives him something to talk about [with constituents] when he goes home, and perhaps to give a speech about at the Republican [National] Convention,” said Democratic Senator Dick Durbin of Illinois.

FILE - Juan Francisco Lopez-Sanchez (R), charged with the murder of 32-year-old Kathryn Steinle, is seen being escorted into a courtroom at the Hall of Justice in San Francisco, July 7, 2015.

Polarizing issue

Immigration has long been a polarizing issue in American politics, but rarely with the intensity of the current presidential election cycle.

Donald Trump has described Mexicans as “rapists,” promised to build a wall between the United States and Mexico, and questioned the impartiality of a federal judge of Mexican descent.

Many Republican lawmakers have distanced themselves from Trump’s statements and bristle at any suggestion they are pushing an anti-immigrant agenda on Capitol Hill.

“We’re a nation of immigrants,” said Majority Leader Mitch McConnell of Kentucky. “We all appreciate the many contributions that immigrants have made to our country over the years.”

He added that the legislation blocked Wednesday “is really aimed at those who come to this country illegally and have criminal convictions.… Extreme sanctuary city policies can inflict incredible pain on innocent victims and their families.”

Democrats countered that the Toomey bill would undermine trust and cooperation between immigrant communities and local law enforcement, and that Cruz’s proposal would lead to incarcerations on a scale the United States could not sustain or afford.

Democrats also noted that in 2013 the Senate passed a comprehensive immigration reform bill that was never taken up by the Republican-controlled House of Representatives.