Locked in a tight reelection battle, Sen. Pat Toomey (R., Pa.) on Wednesday tried to seize on a local development on an issue he has hammered for months - the potential danger created when cities such as Philadelphia give sanctuary to undocumented immigrants.

Toomey called a news conference to highlight the case of an immigrant who had been targeted for deportation in 2014 but instead was released last year by Philadelphia police and now is accused of raping a preteen.

He also attacked his Democratic rival, Katie McGinty, for not taking a stronger stand against the so-called sanctuary cities.

"The problem here is politicians like Katie McGinty who put extreme ideology ahead of public safety," Toomey said.

But in the same moment, the incumbent could not escape questions on an issue he'd probably prefer to avoid: the depth of his support for his party's presidential nominee.

Pressed to answer for the latest controversial comments by Donald Trump, who on Tuesday appeared to condone violence against Hillary Clinton, Toomey said he "didn't know what" Trump meant but that at a minimum the comment was "very careless."

He repeated that he had not decided if he will endorse the nominee. "I remain in a mode of waiting to be persuaded," he said.

Recent polls in his race have shown McGinty closing the gap, with the two nearly even. Some pollsters have read that shift as tied not to the candidates' own actions but rather those of Trump and Clinton.

Toomey on Wednesday said voters can distinguish between his race and the presidential contest. He also accused McGinty, who has pressed Toomey to disavow Trump, of trying to stir controversy to hide her own weaknesses.

"It isn't going to work," he said. "People in Pennsylvania are smart enough to know there are two separate races going on."

McGinty's campaign fired back, saying the GOP presidential nominee's "hinting at the assassination of the Democratic presidential nominee" is not a small issue.

"Donald Trump is a threat to our national security and our constitutional order, so Pat Toomey might want to rethink his words there," McGinty spokesperson Sean Coit said.

Toomey has spent months attacking Philadelphia's sanctuary-city policy, which bars local police from complying with Immigration and Customs Enforcement (ICE) requests to hold undocumented immigrants except in limited circumstances, such as when the person has been convicted of a violent felony.

McGinty, who at first defended local officials' right to have control over law-enforcement decisions, has more recently encouraged Kenney to tweak the city's policy and blamed Toomey for voting against immigration reform.

Toomey in turn has cast McGinty as radical, saying she has defended sanctuary cities even as some leading Democrats say the policies should be rescinded.

The case Toomey sought to highlight focused on Ramon Aguirre-Ochoa, who was deported in 2009 but returned to the United States illegally, according to ICE.

Aguirre-Ochoa, who has also gone by the name Juan Ramon Vasquez and had an address in Upper Darby, was arrested in 2014 and charged with aggravated assault but released by Philadelphia police the following year when the charges were dropped - even though ICE had issued a detainer requesting he be held.

Last month, Philadelphia officers arrested Aguirre-Ochoa and charged him with raping the child, who was younger than 13, something Toomey said "would not have been possible but for the fact that Philadelphia is a sanctuary city."

Lauren Hitt, spokeswoman for Mayor Kenney, said that was not the case and the city would have turned Aguirre-Ochoa over had the U.S. received an arrest warrant for the violation of his deportation order. "If they had done so, the individual would have been released into their custody without any interference from the city," Hitt said.

Toomey called that "too high a hurdle," and noted police routinely make arrests without warrants.

tnadolny@phillynews.com

215-854-2730 @TriciaNadolny