A federal judge in Texas has dismissed a long-shot lawsuit by Rep. Louie Gohmert (R-Tex.) that sought to overturn the presidential election, saying neither the congressman nor his allies have legal standing to pursue the case.

The judge’s Friday night ruling tosses out what many election law experts considered a far-fetched theory to challenge the formal mechanism by which President-elect Joe Biden will be affirmed as the winner of the race for president.

U.S. District Judge Jeremy D. Kernodle issued an order dismissing the case because, he found, neither Gohmert nor his fellow plaintiffs have a sufficient legal stake in the process to justify the lawsuit. Kernodle was nominated to the federal bench by President Trump.

The judge’s ruling comes less than 12 hours after lawyers for Gohmert filed court papers arguing that Vice President Pence has far more power than the government claims to alter the outcome of the presidential election. Gohmert’s lawyers filed a notice of appeal later Friday night.

Weeks before the 2020 presidential election, congressional Republicans said President Trump would accept the election result. (The Washington Post)

Kernodle wrote that previous court cases make clear that an individual member of Congress cannot sue for a harm supposedly done to the larger legislature. Additionally, the judge found, Gohmert’s claim of harm is a series of hypothetical scenarios stacked on top of each other, further undercutting any authority for the court to intervene.

“Plaintiffs presuppose what the Vice President will do on January 6, which electoral votes the Vice President will count or reject from contested states, whether a Representative and a Senator will object under Section 15 of the Electoral Count Act, how each member of the House and Senate will vote on any such objections, and how each state delegation in the House would potentially vote under the Twelfth Amendment absent a majority electoral vote,” the judge wrote. “All that makes Congressman Gohmert’s alleged injury far too uncertain to support standing.”

In response to a Justice Department request to reject the suit, the Friday filing by Gohmert’s legal team accused the government of trying to “hide behind procedural arguments.” Gohmert’s lawyers contended that arguments made by the Justice Department and Congress — that the suit upends long-established procedures and that Pence is an inappropriate target for the suit — are unfounded.

“They say that the Vice President, the glorified envelope-opener in chief, has no authority to preside over anything else or to decide anything of substance or to even count the votes in those weighty envelopes. He is only the envelope-opener,” Gohmert’s filing states.

Gohmert claimed the vice president has the power to effectively pick the next president during the formal recording of electoral college votes by Congress on Wednesday. Pence oversees that ceremony and, as president of the Senate, has the power to declare Biden electors in a handful of key states invalid and instead recognize electors supporting Trump, the filing contends.

Pence “may count elector votes certified by a state’s executive, or he can prefer a competing slate of duly qualified electors. He may ignore all electors from a certain state. That is the power bestowed upon him by the Constitution,” the filing states.

Gohmert and a number of Republicans in Arizona filed the suit in Texas, arguing that an 1887 law governing how Congress certifies presidential elections is unconstitutional. They argue that the Constitution gives the vice president discretion to determine which states’ electors are valid for choosing the president.

While experts agree that 19th-century law is vague and confusing, it has never before been challenged; it has been accepted by officials in both parties for more than 130 years as establishing a process in which voters choose electors who choose the president. This past year, 81 million voters supported Biden, earning him 306 electoral college votes to Trump’s 232.

In a Thursday night filing, a Justice Department lawyer wrote on Pence’s behalf that the case is “a walking legal contradiction,” because Gohmert has sued Pence seeking to give Pence more power. If Gohmert and his allies want to make such a claim, the Justice Department argued, they should sue Congress, not Pence.

Lawyers for the House of Representatives also asked the judge to reject the Gohmert suit, arguing that it called for “a radical departure from our constitutional procedures and consistent legislative practices” and would “authorize the Vice President to ignore the will of the Nation’s voters.”

While the the legal challenge to next week’s joint session appeared to lose steam, the political drama within the Republican Party is likely to intensify in the coming days.

Sen. Ben Sasse (R-Neb.) called the effort to use the congressional process to reverse Biden’s electoral college victory a “dangerous ploy,” underscoring the challenge Trump faces in persuading even members of his own party to join it.

Sasse wrote to his constituents that there is no evidence of outcome-altering voter fraud and said he has urged his colleagues to reject “a project to overturn the election.”

“All the clever arguments and rhetorical gymnastics in the world won’t change the fact that this January 6th effort is designed to disenfranchise millions of Americans simply because they voted for someone in a different party,” Sasse wrote on Facebook. “We ought to be better than that.”

Sasse has been far more willing to criticize Trump than most of his GOP colleagues, but even so, his staunch opposition highlights the near-certain futility of the president’s efforts to hang on to power.

On the other side of the GOP, Sen. Josh Hawley (Mo.) announced he will object next week when Congress convenes to certify the electoral college vote, a move that would force a contentious floor debate that top Senate Republicans had hoped to avoid.

Trump has repeatedly and falsely suggested that the ceremonial milestone offers a last-ditch way to reverse the election results and is urging Republicans to join such efforts.

But to succeed, Trump would not only have to prevail in the Republican-led Senate but also in the House, which is controlled by Democrats.

The objections would come during a joint session of Congress on Wednesday. According to the Constitution, Pence will read aloud electoral college votes cast in each state in December.

Any member of the House, joined by a senator, can object to a state’s electoral college votes, prompting two hours of debate in each chamber, followed by a vote on the challenge.

Senate Majority Leader Mitch McConnell (Ky.) and other leading Republicans have discouraged members of their caucus from challenging the electoral college vote, conceding that the move would fail but could drag out the process through lengthy debate and force Republicans to take an awkward vote.

A number of other Senate Republicans have acknowledged Biden’s victory, and several — including Sens. Susan Collins (Maine), Patrick J. Toomey (Pa.) and Mitt Romney (Utah) — said this week that they plan to oppose any challenge to the electoral college vote.

Hawley, meanwhile, who is believed to be contemplating a run for president in 2024 and is eager to garner support among Trump’s base, began citing his plans in fundraising appeals for his campaign committee Thursday.

More Republicans are expected to sign on to challenges in the House, but their relatively small numbers there mean the effort will likely amount to little more than a show of loyalty to Trump.

Seven House Republicans from Pennsylvania on Thursday issued a joint statement indicating they plan to contest the results from their own state, blaming the Democratic governor, secretary of state and a “rogue Pennsylvania Supreme Court” for Biden winning more votes.

They did not allege fraud but complained about several issues involving the administration of the state’s elections. Similar complaints have already been litigated in state and federal courts in Pennsylvania, and the Republican-led legislature declined to interfere with the certified results, which showed that Biden defeated Trump by more than 81,000 votes in the state.