HARRISBURG, Pa. — Republican U.S. Sen. Pat Toomey of Pennsylvania has refused to endorse Donald Trump for president, but said Thursday he would be supportive of a Trump nominee to the Supreme Court and that giving Democrats control of the Senate would frustrate a Trump agenda.

Toomey is locked in a close race with Democrat Katie McGinty, and has pointed to his stance on the GOP’s presidential nominee as a sign of independence. He accused McGinty, who once worked in Bill Clinton’s White House, of being a “rubber stamp” for Hillary Clinton, should the Democratic nominee be elected.

Chris Stigall, a Philadelphia radio host, told Toomey during his show Thursday that he tells friends frustrated by Toomey’s refusal to endorse Trump that he believes Toomey would support a Trump court nominee.

Toomey said he has said that publicly “many times.” Toomey went on to say that Trump, if he becomes president, cannot accomplish anything with Democrats in power and that, if Clinton becomes president, a Republican senator would provide a check on her administration.

“Honestly, I think whoever you’re voting for at the top of the ticket, you want to have a Republican Senate,” Toomey said on WPHT-AM.

Toomey, a first-term senator, is one of the most vulnerable Republicans as the GOP struggles to hold onto its Senate majority. A McGinty victory could tip Senate control to Democrats.

Recent polls show Hillary Clinton leading Trump in Pennsylvania, and Clinton’s strength boosts McGinty, especially with registered Democrats outnumbering Republicans four-to-three in the state.

Toomey has said previously he was “encouraged” by Trump’s short list of would-be high court nominees since the Republican-controlled Senate has refused to consider the nominee, Merrick Garland, put forward in March by President Barack Obama, a position Toomey agreed with. Still, he has criticized Trump’s vulgarity, his lack of devotion to conservative principles and his vagueness about what he would do as president, or how.

Toomey has faced criticism from Trump supporters over his refusal to endorse the billionaire developer, and McGinty has heavily criticized Toomey’s unwillingness to say whether he will vote for Trump and to more strongly disavow Trump, as have at least three Republican congressmen from Pennsylvania.

“It seems to me that Senator Toomey is putting his political interests ahead of the interests of his constituents and, really, basic human decency,” McGinty told reporters on a conference call Thursday. “And it’s past time for Senator Toomey to explain how he can still, at this juncture, still be standing with Donald Trump.”

Toomey has said he would not vote for Clinton.

On Thursday, Toomey renewed criticism that McGinty is not sufficiently independent of Clinton.

“I’m supposed to defend every word from him, having not endorsed him, and she can’t defend the actions and the lies of Hillary Clinton, having fully endorsed her,” Toomey said. “The bottom line is very clear: She’s absolutely a rubber stamp for Hillary Clinton.”

McGinty has hewed closely to Clinton’s policy positions, and at the Pennsylvania Press Club on Aug. 22 was unwilling to cite any sort of policy difference with Clinton when asked for examples.

On Thursday, the McGinty campaign said McGinty has disagreed with Clinton on a number of issues, including what to do with inmates from Guantanamo Bay prison, and that she disagreed with Clinton’s use of a private server instead of a State Department computer system for her work-related emails while she was secretary of state.