MILWAUKEE — The commanding victory on Tuesday by a liberal candidate in a pivotal race for the Wisconsin Supreme Court showed the enduring power of abortion rights and issues of democracy as motivators for Democratic voters, as well as a continuing struggle among conservatives to put forward candidates who can unite Republicans and win general elections.

The liberal candidate, Janet Protasiewicz, swept onto the bench by 11 percentage points, a staggering margin in an evenly divided battleground state that signaled just how much last summer’s Supreme Court decision overturning Roe v. Wade has transformed American politics.

The Wisconsin race centered squarely on abortion rights and political representation: Judge Protasiewicz all but promised voters that if they elected her, the court’s new 4-to-3 liberal majority would reverse Wisconsin’s 1849 abortion ban and overturn the state’s famously gerrymandered, Republican-friendly legislative maps.

Wisconsinites responded to that pitch, rejecting a conservative candidate backed by anti-abortion groups who took 2020 election deniers as a client and struggled to rally Republican donors behind him.

The outcome, combined with a surprise victory in Chicago’s mayoral race by Brandon Johnson, an outspoken progressive, demonstrated that the country’s largely unified political left is sustaining momentum since its unexpectedly strong showing in the midterm elections, even as conservatives fight among themselves and struggle to counter Democratic messaging on abortion rights.

Republicans are now heading into a series of coming races — for Kentucky governor this year and for president and an array of Senate seats in 2024 — with ample warning signs about the pitfalls of nominating candidates who hold positions on issues like abortion and elections that are unpopular with voters in the nation’s most competitive states.

The triumph by Judge Protasiewicz, a liberal Milwaukee County judge, will also allow Wisconsin Democrats to pursue their own agenda through the courts after spending a dozen years ducking and running at most levels of state politics, worrying about what the dominant Republicans would lob at them next.

“For a long time, Democrats in the Assembly have understood that our role is primarily being on defense,” Greta Neubauer, who leads the chamber’s Democratic minority, said at Judge Protasiewicz’s victory party in Milwaukee. Now, Ms. Neubauer said, “we have an opportunity to go on offense.”

Judge Protasiewicz will be seated on the court on Aug. 1. A legal challenge to the state’s abortion ban is scheduled to begin in circuit court in Dane County next month, and while it is unclear when the ban could come before the State Supreme Court, the justices are widely expected to hear the case within a year or two and strike down the ban. Liberal lawyers are also eyeing the best way to frame a lawsuit that could prompt the court to throw out the Republican-drawn maps.

It will be many months, at least, before there is a final State Supreme Court resolution on those and other hot-button issues likely to come before the court’s new liberal majority, which will consist of four women for the first time in the state’s history.

To emphasize that point, when Judge Protasiewicz arrived to deliver her victory remarks on Tuesday night, she was trailed by the three sitting liberal justices as the sound system played Lizzo’s “About Damn Time.”

“Today’s results mean two very important and special things,” Judge Protasiewicz told supporters. “First, it means that Wisconsin voters have made their voices heard. They have chosen to reject partisan extremism in this state. And second, it means our democracy will always prevail.”

Judge Protasiewicz defeated Daniel Kelly, a conservative former State Supreme Court justice who also lost an April 2020 election by 11 points and went on to represent the Republican National Committee in its efforts to overturn President Donald J. Trump’s defeat that year.

Justice Kelly, who has long been an opponent of abortion rights, did little to parry Judge Protasiewicz on the issue. He never mentioned abortion in his television advertising and, during his final rally on Monday night in Waukesha, a parade of Republican officials spoke for more than an hour without mentioning abortion.

Instead, Justice Kelly and his allies focused almost entirely on crime, an issue that also fell flat in Chicago, where Mr. Johnson, a liberal candidate, defeated Paul Vallas, who had tethered his campaign to a tough-on-crime message.

Asked about his relative silence on abortion, Justice Kelly said that “the court does not do political decisions,” adding, “The question of abortion, that belongs in the Legislature to decide.”

That approach turned Justice Kelly into a denier of the current political reality.

Supportive right-wing radio hosts complained that he had not defended the state’s abortion ban, and conservative donors, whom Justice Kelly was reluctant to call to ask for money, steered clear of his campaign. And not enough of Wisconsin’s legions of conservative grass-roots voters were energized by his campaign speeches, which delved into legal theory and lamented his severe financial disadvantage.

“Doing a statewide campaign, as it turns out, is kind of hard,” Justice Kelly said at the Waukesha rally.

On Wednesday, Mr. Trump blamed Justice Kelly, whom he endorsed in 2020, for neglecting to seek his endorsement this year, arguing on his social media site that this “guaranteed his loss.”

Democrats in Wisconsin and beyond gave the Protasiewicz campaign a decided financial edge. Gov. J.B. Pritzker of Illinois organized a March 6 videoconference that raised $5 million for the Protasiewicz campaign, the Democratic Party of Wisconsin and allied groups. The party transferred $8.3 million to the Protasiewicz campaign.

The Republican Party of Wisconsin gave no money directly to Justice Kelly. Instead, Republican donors poured $12 million into third-party groups, whose rates for television advertising are three times what candidates pay.

Brian Schimming, the Wisconsin G.O.P. chairman, lamented the disparity and donors’ decision to keep an arm’s-length distance from Justice Kelly’s campaign.

“There’s a fair bit of chatter about that right now,” he said. “We could have done a more efficient job of spending it.”

After abortion, the biggest issue facing the new liberal court will be the state’s legislative maps.

Jeffrey A. Mandell, the board president and founder of Law Forward, a progressive law firm in Madison, said he aimed to have new maps in place in time for the 2024 election, which would most likely require the case to be decided and new maps to be drawn by next April, when candidates begin circulating petitions to qualify for the primary ballot.

“There’s no time to waste,” Mr. Mandell said.

The three sitting liberal justices declined to say whether they believed it was possible to have new maps ready for 2024, but Judge Protasiewicz said it was “unlikely” the court could decide a case and put new maps into effect by next year’s elections.

Liberals will hold a 4-to-3 majority on the court through at least 2025, when Ann Walsh Bradley, a 72-year-old liberal justice poised to become the new chief justice under the new majority, faces re-election. Justice Bradley said Tuesday night that she would run for a fourth 10-year term.

Democrats are hopeful about her chances: Since the Wisconsin Supreme Court began electing justices statewide in 1853, no justice who has won a competitive election, as Justice Bradley has done twice, subsequently lost one.

Beyond abortion and redistricting, the new liberal majority will decide a host of other issues, including labor rights that were diminished by Republicans.

Stephanie Bloomingdale, the president of the Wisconsin A.F.L.-C.I.O., said she had watched with jealousy this year as Michigan Democrats enacted a wide range of liberal policies after redistricting helped them take full control of their state government for the first time in 40 years.

“We see them, we’re very proud of them, but we’re wishing it could be us,” Ms. Bloomingdale said. “You know, in Wisconsin, we can have nice things, too.”

Even before Election Day, Wisconsin Republicans who saw that a liberal victory was likely began to disparage their State Supreme Court as an illegitimate body.

“I don’t think people have any idea of what’s coming,” said Rebecca Bradley, a conservative Supreme Court justice who in a decision banning drop boxes last year compared the state’s 2020 presidential contest to elections in Syria, North Korea and Saddam Hussein’s Iraq. “We will have four people in Wisconsin robbing the people of the right to govern themselves.”

But the scale of Judge Protasiewicz’s victory suggests that Wisconsin voters are inclined to dismiss the Republican arguments. She carried 27 of the state’s 72 counties — 11 more than Mr. Evers did when he was re-elected in November by three points — and nearly equaled the margin by which Jill Karofsky, a fellow liberal, defeated Justice Kelly in the 2020 election, when Democrats held their presidential primary on the same ballot.

“I’m not concerned about the legitimacy of the court, because so many people voted for this court,” Justice Karofsky said as she nursed a Miller Lite at the Protasiewicz victory party. “So many people wanted this majority.”