GETTYSBURG — Having failed to gain traction in court, President Donald Trump’s campaign brought its case challenging Pennsylvania’s election results to a state Senate hearing Wednesday in Gettysburg, where it repeated its unfounded claims of widespread fraud to a welcoming audience of Republican legislators.

Addressing members of the state Senate Majority Policy Committee in a proceeding that played out like a campaign rally — with firebrand speeches from GOP lawmakers and whooping cheers from dozens of supporters — Trump lawyer Rudy Giuliani pressed his baseless case that the election had been stolen and the truth covered up by “Big Tech,” the media, and the courts.

“I know crooks really well,” he told the panel, gathered in a conference room of the Wyndham Gettysburg hotel. “You give them an inch and they take a mile. And you give them a mile and they take your whole country.”

Then, with Trump attorney Jenna Ellis holding a cell phone to a microphone, the president himself addressed the crowd from Washington.

“This election was rigged, and we can’t let that happen,” Trump said falsely. “This election has to be turned around because we won Pennsylvania by a lot and we won all these swing states by a lot.”

The hearing came a day after state officials officially certified Pennsylvania’s presidential election results, cementing Joe Biden’s win over Trump by some 81,000 votes. But its circus-like atmosphere capped a few hours marked by last-minute reversals and scrambling both in and out of the hotel.

Trump had been scheduled to attend the gathering, which would have been his first public appearance outside of Washington since his loss to Biden. But those plans were scuttled Wednesday morning without explanation, according to White House pool reports.

The cancellation sent Senate staffers rushing to adjust the agenda. Even Giuliani’s attendance was briefly thrown into doubt after news broke that a presidential adviser who had been working closely with Trump’s legal team had tested positive for coronavirus.

Then, just before the former New York City mayor did begin testifying, a Pennsylvania appellate court issued an order temporarily barring the state from finalizing its election results — something Gov. Tom Wolf had already done the day before.

That ruling, from a Commonwealth Court judge, came in response to a lawsuit from U.S. Rep. Mike Kelly (R., Butler), one of Trump’s top boosters in Congress, who has asked the court to throw out the election results and appoint Pennsylvania’s GOP-controlled legislature to choose the victor in the state.

The judge, Republican Patricia A. McCullough, scheduled a hearing Friday for arguments on Kelly’s claim that the new law that allowed widespread mail voting in the state for the first time was enacted in violation of the state’s constitution, despite overwhelming support from GOP lawmakers at the time.

It was unclear if the case before McCullough would survive. Calling the decision an “extraordinary act of judicial overreach,” state officials appealed to Pennsylvania’s Supreme Court, triggering an immediate pause on her order and the proceedings scheduled for later in the week.

”Since the birth of our nation nearly 250 years ago, no court has ever issued an order purporting to interfere with the state’s [selection] of its presidential electors — until today,” wrote Michele D. Hangley, lawyer for the state, adding: “If the [order] is allowed to stand, even for a short time, it will have a cascading and potentially devastating effects across the Commonwealth.”

As a practical matter, McCullough’s ruling has little effect on the outcome of Pennsylvania’s presidential race since the governor has already appointed the electors that will give Biden the state’s 20 electoral votes.

» READ MORE: Pennsylvania certifies its presidential election results, officially declaring Joe Biden the winner

But for the moment, it injected uncertainty into several down ballot races that still have not been certified by the Department of State — including Kelly’s own reelection and those of many of the state Senators gathered Wednesday.

Any further delay in certification could plunge the Capitol into chaos because all members of the state House of Representatives and half of the 50 state senators officially end their terms Monday. Lawmakers can’t be seated in districts where the results haven’t been officially certified.

That did not appear to trouble state Sen. Doug Mastriano (R., Franklin), who had organized Wednesday’s committee hearing and kicked it off with a speech in which he declared the very future of “the republic is at stake.”

“There have been many allegations of voting law violations across the state,” he said. “We are here today to try to find out what the heck happened.”

Though they didn’t attend the hearing, Senate Democrats immediately pushed back.

“If Senate Republicans want to entertain conspiracy theories from Rudy Giuliani and rally with defeated presidential candidate Donald Trump, they should do so on their own time and dime — not the taxpayers,” Senate Minority Leader Jay Costa (D., Allegheny) said in a statement. “Our process was secure and our count is accurate.”

The Senate Majority Policy Committee has no Democratic members and no power to advance legislation. And there, Giuliani found a friendly forum for his unfounded claims that Democrats had taken advantage of the widespread use of mail ballots in Pennsylvania this year to turn the vote in Biden’s favor.

A parade of witnesses repeated often-aired GOP complaints about their access to observe the counting of votes and the fact that some counties, following state guidance, allowed voters to correct technical mistakes such as missing signatures or secrecy envelopes in their mail ballots.

Most of the GOP senators had supported the law that created no-excuse voting by mail. None, however, mentioned that or that the 2.6 million mail ballots cast statewide in 2020 helped their party expand its majority in the General Assembly.

Still, Trump urged the panel to wrest control away from the state’s voters and appoint Pennsylvania’s electors themselves, if a court won’t give him what he wants.

After the hearing concluded Wednesday, several of the senators who organized it headed to Washington at the invitation of the president so he could continue to press that case during an evening White House visit, CNN reported. But given that electors had already been appointed, it was unclear how state lawmakers could do anything to change the status quo.

Senate Majority Leader Jake Corman (R., Centre) and House Majority Leader Kerry Benninghoff (R., Centre) have said on numerous occasions that the legislature will have no role in deciding the outcome of the 2020 presidential election. On Wednesday, spokespeople for Corman and Benninghoff said the leaders’ positions had not changed.

And yet, the president persisted. ”We have all the evidence,” he said during Wednesday’s proceedings. “All we need is to have some judge listen to it properly.”

So far, the judges who have listened have found Trump’s case sorely lacking. Of the 12 Pennsylvania lawsuits his campaign has filed in state and federal courts since Election Day, it has lost 11. In many of those cases, Trump’s attorneys have acknowledged that they do not believe voter fraud occurred with any of the ballots they are contesting — despite the president’s public claims.

In a scathing opinion Saturday, a federal judge in Williamsport dismissed the campaign’s most significant legal challenge to date, describing it as a “Frankenstein’s monster” of legal claims, lacking in evidence, that, if granted, would effectively disenfranchise all of Pennsylvania’s voters.

Campaign lawyers asked the U.S. Court of Appeals for the Third Circuit for yet another chance to allow Giuliani to present that case at oral arguments in Philadelphia in a new filing Wednesday.

They argued that despite Wolf’s certification of the election results Monday, a federal court could still “decertify” that vote any time before Dec. 8 — the federal deadline for the state to select its electors.

The Third Circuit judges have not yet indicated whether they intend to hold a hearing.

Cynthia Fernandez of Spotlight PA contributed to this article.