Seeking to inject some star power into his foundering legal effort to invalidate Pennsylvania’s election results, President Donald Trump handed the case to Rudy Giuliani on Tuesday. But rather than salvage it, the former New York mayor found himself grilled for hours by a skeptical federal judge over his unsupported claims of a conspiracy to steal the election.

During a five-hour hearing in Williamsport, U.S. District Judge Matthew Brann appeared mystified as Giuliani asserted without evidence that a “Mafia-like” cabal of Democratic leaders in cities nationwide used mail ballots to rig the election in Joe Biden’s favor.

The judge seemed equally perplexed by the Trump campaign’s proposed remedy: that he should bar Pennsylvania from certifying its final vote tally.

“At bottom, you’re asking this court to invalidate some 6.8 million votes thereby disenfranchising every single voter in the commonwealth,” Brann said. “Can you tell me how this result could possibly be justified?”

Giuliani, a last-minute addition to the Trump team’s legal roster for the pivotal hearing, personally presented the campaign’s arguments in court. In the first federal case he has argued in nearly three decades, he varied between struggling, at times, to comprehend the judge’s questions on finer points of the law and boldly speculating, at others, about widespread fraud and malfeasance.

“If this is allowed without serious sanction, it’s going to become an epidemic,” Giuliani said. “It’s already happened. You give them an inch, they’ll take a mile. They stole an election, at least in this commonwealth.”

As the hearing stretched into Tuesday night, Brann indicated that he did not intend to rule immediately and laid out a briefing schedule that would appear to preclude any decision in the case before Friday.

And yet, he canceled a planned hearing for Thursday in which Trump campaign lawyers had hoped to elicit testimony from witnesses who say they observed wrongdoing during the casting and counting of votes in seven Democratic-leaning counties, including Philadelphia and its suburbs.

“I don’t think there’s a need for a hearing at this juncture,” the judge said. He cautioned, however: “I don’t want to sound like I’ve decided the matter yet. I need to mull it over, frankly.”

Giuliani’s presence only underscored the importance the Trump campaign has placed on its case in Pennsylvania — one that increasingly appears to be the president’s last legal stand as judges in other battleground states have knocked down his lawsuits one-by-one.

But just as the case has grown in importance, so too has the margin of Trump’s Pennsylvania loss. As of Tuesday evening, Biden held a 73,000-vote advantage with the count rapidly approaching its conclusion.

The Trump campaign’s central argument is that the entire process of casting and counting votes in Pennsylvania was so opaque and riddled with inconsistencies that no one can trust the outcome.

Yet all of the claims of fraud made Tuesday were speculative. To date, Trump campaign lawyers have yet to lodge even one specific allegation — let alone provide evidence — of a ballot that was deliberately cast illegally.

Instead, it has zeroed in on counties, including Philadelphia, that contacted voters whose mail ballots were in danger of being disqualified due to deficiencies such as missing signatures or secrecy envelopes.

In some cases, county election officials — following guidance from Pennsylvania’s top elections official, Secretary of State Kathy Boockvar — allowed voters to either correct those errors before Election Day or cast a provisional ballot in-person at the polls.

Trump campaign lawyers told Brann on Tuesday that the practice is unlawful and unfairly diluted votes in GOP-leaning counties that did not offer similar opportunities to their voters.

Boockvar’s lawyers contend that state election law does not prohibit counties from alerting voters when they file flawed ballots. What’s more, they say, she issued the same guidance to all of Pennsylvania’s 67 counties encouraging them to follow this process.

“I say, ‘Hallelujuah!’ to Secretary Boockvar,” said Mark Aronchick, an attorney representing the counties. “What in the world is wrong with telling counties they can advise voters that their mail ballot is rejected so they can go to the polls and exercise their right to have their vote counted? … That is a problem? Hardly.”

Giuliani also pressed the judge Tuesday to rule in their favor based on reports from campaign monitors who say they were prevented from “meaningfully” monitoring the counting of votes in Democratic-leaning counties, including Philadelphia.

There, GOP observers have complained they were kept behind waist-high metal barriers too far away from the tables where votes were being tallied to actually inspect the ballots.

But even as Giuliani was offering that argument in Brann’s court, the Pennsylvania Supreme Court issued a ruling undercutting it.

In a 5-2 decision, the state’s justices sided with the city, saying it had complied with state laws that require only that partisan monitors be granted access to counting rooms. The statute does say anything about how closely they may observe the actual ballots being tallied.

Chief Justice Thomas G. Saylor, a Republican, dissented — but primarily to note that with the counting all but done in the state, the matter was moot. Like Brann, he balked at the Trump campaign’s proposed solution to its perceived wrong.

“Short of demonstrated fraud, the notion that presumptively valid ballots cast by the Pennsylvania electorate would be disregarded based on isolated procedural irregularities … thus disenfranchising potentially thousands of voters is misguided,” he wrote.

Attorneys representing Boockvar and the defendant counties in the federal case quickly marshaled the ruling into their arguments in Brann’s courtroom.

“Mr. Giuliani’s witnesses had their right to observe,” Aronchick said. “That’s over. End of story.”

As for the rest of the Trump campaign’s claims, Aronchick rebutted them all in a 30-minute presentation that rhetorically aimed for Giuliani’s jugular, accusing him at various points of being “ignorant” of the law, living in “some fantasy world,” and perpetuating wild conspiracy theories that were “disgraceful in an American courtroom.”

He argued the campaign had no standing or evidence to pursue its case any further and urged Brann to follow the lead of other judges across the country.

“Please dismiss this case so we can move on to the real business of this country,” Aronchick pleaded with the judge. “We need to get this election certified.”