HOUSTON — The Supreme Court on Friday rejected a lawsuit backed by President Donald Trump to overturn Joe Biden’s election victory, ending a desperate attempt to get legal issues rejected by state and federal judges before the nation’s highest court.

The court’s order was its second this week rebuffing Republican requests that it get involved in the 2020 election outcome. The justices turned away an appeal from Pennsylvania Republicans on Tuesday.

The Electoral College meets Monday to formally elect Biden as the next president.

More than half of House Republicans, including their top two leaders, backed the Texas lawsuit seeking to invalidate President-elect Joe Biden’s victory in an extraordinary display of the party’s willingness to subvert the will of voters.

Seventeen Republican attorneys general and 126 members of Congress joined Texas and President Donald Trump in urging the U.S. Supreme Court to throw out millions of votes in four battleground states based on baseless claims of fraud. On Friday, House Republican Leader Kevin McCarthy of California and Minority Whip Steve Scalise of Louisiana signed onto a brief backing the longshot bid, demonstrating Trump’s remarkable political power even as he spreads false claims that many Democrats and others fear risk deeply damaging democracy.

“This lawsuit is an act of flailing GOP desperation, which violates the principles enshrined in our American Democracy,” House Speaker Nancy Pelosi wrote in a message to Democrats on Friday.

A few Republicans have expressed concerns about the case. Many others have remained silent.

“Texas is a big state, but I don’t know exactly why it has a right to tell four other states how to run their elections. So I’m having a hard time figuring out the basis for that lawsuit,” Republican Sen. Lamar Alexander told NBC’s Chuck Todd in an interview for “Meet The Press” that will air Sunday.

To be clear, there has been no evidence of widespread fraud. Election law experts think the lawsuit will never last.

“The Supreme Court is not going to overturn the election in the Texas case, as the President has told them to do,” tweeted Rick Hasen, a law professor at the University of California, Irvine. “But we are in bad shape as a country that 17 states could support this shameful, anti-American filing” by Texas and its attorney general, Ken Paxton, he said.

The lawsuit filed against Michigan, Georgia, Pennsylvania, and Wisconsin repeats false, disproven, and unsubstantiated accusations about the voting in four states that went for Trump’s Democratic challenger. The case demands that the high court invalidate the states’ 62 total Electoral College votes. That’s an unprecedented remedy in American history: setting aside the votes of tens of millions of people, under the baseless claim the Republican incumbent lost a chance at a second term due to widespread fraud.

Two days after Paxton sued, 17 states filed a motion supporting the lawsuit, and on Thursday six of those states asked to join the case themselves. Trump has acted to join the case, tweeting Thursday that “the Supreme Court has a chance to save our Country from the greatest Election abuse in the history of the United States.” Hours later, Trump held a meeting at the White House, scheduled before the suit was filed, with a dozen Republican attorneys general, including Paxton and several others who backed the effort.

The case inflamed already high tensions over the election. West Virginia Attorney General Patrick Morrisey said his office staff received two death threats Thursday after he signed onto the brief supporting the case.

The lawsuit has also divided officials in some states.

Montana Attorney General Tim Fox is supporting Texas’ case, even though he said the suit was “belated” and its chances “are slim at best.” Fox said the case raised “important constitutional questions about the separation of powers and the integrity of mail-in ballots in those defendant states.”

But Gov. Steve Bullock, D-Mont., had urged the court to reject the case. He said the fact that Texas is not suing Montana, which Trump won, even though the state similarly used mail-in ballots underscores that “this action is less about election integrity than it is about attempting to overturn the will of the electorate.”

The litigation rankled Democratic attorneys general. Massachusetts Attorney General Maura Healey, co-chair of the Democratic Attorneys General Association, called the attempt to overturn votes “unconscionable.” Support among other leading lawyers was disturbing, Nevada Attorney General Aaron Ford, who’s also co-chair of the Democratic attorneys general group, told The Associated Press.

“I do think that these individuals are kowtowing to a president who has implemented some level of control and authority over the duly elected attorneys general in their states in a way that is unfortunate,” he said.

“I do think that this is a dangerous precedent to initiate.”

Suits brought by Trump and his allies have failed repeatedly across the country, and the Supreme Court this week rejected a Republican bid to reverse Pennsylvania’s certification of Biden’s victory.

Trump has spent the week relentlessly tweeting about the Texas case with the hashtag “overturn” and claiming, falsely, that he had won the election but was robbed.

Many of the attorneys general supporting the case have shown greater political ambitions.

In Kansas, Republican Attorney General Derek Schmidt, who is considering a bid for governor in 2022, announced that he would back the effort only hours after former Republican Gov. Jeff Colyer — another potential candidate for governor — tweeted that Schmidt’s office should.

Officials in Michigan, Pennsylvania, Georgia and Wisconsin say the suit is a publicity stunt. More than 20 other attorneys general from states including California and Virginia also filed a brief Thursday urging the court to reject the case.

Despite the political pressure, Idaho’s Republican attorney general chose not to join Texas.

“As is sometimes the case, the legally correct decision may not be the politically convenient decision,” Lawrence Wasden said in a statement. “But my responsibility is to the state of Idaho and the rule of law.”

Story by Nomaan Merchant and Alanna Durkin Richer. Contributing to this report were Associated Press writers David Pitt in Des Moines, Iowa; John Hanna in Topeka, Kansas; Amy Beth Hanson in Helena, Montana; James MacPherson in Bismarck, North Dakota, Keith Ridler in Boise, Idaho; Michelle Price in Las Vegas and Sophia Eppolito and Lindsay Whitehurst in Salt Lake City.