Wisconsin’s Supreme Court denies a last-ditch Trump effort to toss 200,000 votes from Milwaukee and Madison.

The Wisconsin Supreme Court on Monday denied President Trump’s attempt to invalidate more than 200,000 votes in the state’s two biggest Democratic bastions for the second time this month.

The ruling ends the president’s efforts to overturn the result of the election just hours before the Electoral College is set to cast the state’s 10 votes for President-elect Joseph R. Biden Jr.

In a 4-3 decision, the conservative-leaning court rejected the Trump campaign’s attempt to throw out votes in Milwaukee County and Dane County, which includes Madison.

The campaign had asked courts to throw out votes cast by voters who declared themselves indefinitely confined, voters who delivered absentee ballots at October events hosted by the Madison city clerk, voters who cast ballots at in-person early-voting sites and absentee ballots in which the voter’s witness did not provide a complete mailing address.

“We conclude the Campaign is not entitled to the relief it seeks,” wrote Justice Brian Hagedorn, a conservative who sided with the court’s three liberal justices. He added that “the challenge to the indefinitely confined voter ballots is meritless on its face, and the other three categories of ballots challenged fail under the doctrine of laches” — meaning that the campaign took too long to file the suit.

The State Supreme Court had already rejected on Dec. 3 an attempt by the Trump campaign to file the suit directly with it. So the Trump campaign refiled the suit in lower courts in Milwaukee and Madison, then when those courts ruled against it, appealed to the Supreme Court, which heard the case.

Monday’s ruling snuffs out the faint legal hope Mr. Trump had of flipping Wisconsin from Mr. Biden, who won the state by 20,000 votes out of 3.2 million cast.

In their dissent, three of the court’s conservative justices argued the Trump campaign found “troubling allegations of noncompliance with Wisconsin’s election laws” by municipal clerks and the state elections commission.

“The majority’s failure to act leaves an indelible stain on our most recent election,” Justice Rebecca Bradley wrote, in a dissent signed by two conservative justices. “It will also profoundly and perhaps irreparably impact all local, statewide, and national elections going forward, with grave consequence to the State of Wisconsin and significant harm to the rule of law.”

She added: “The majority’s failure to discharge its duty perpetuates violations of the law by those entrusted to administer it.”

The Trump lawsuit did not allege any fraud in Wisconsin’s election. Instead it argued that municipal clerks in Milwaukee County and Dane County should not have been allowed to complete address forms for witnesses to absentee ballots, which the Wisconsin Elections Commission had given them permission to do. State law requires absentee voters to have witnesses sign their ballot envelopes.

The suit did not seek to invalidate ballots cast anywhere else in the state — where voters are far more likely to have supported Mr. Trump.

The lawsuit also asked the court to invalidate ballots that were collected by the Madison municipal clerk at October gatherings in city parks, though those events were also blessed by the elections commission.

It also sought to throw out ballots cast by voters who declared themselves indefinitely confined to their homes during the coronavirus pandemic.

And, in its boldest argument, the Trump campaign argued that all in-person absentee ballots were cast in violation of state law — an assertion that would have thrown out its own lawyer’s vote.