MADISON, Wis. — Thousands of Wisconsin voters waited hours in long lines outside overcrowded polling stations on Tuesday, ignoring federal health recommendations so they could participate in a presidential primary election that tested the limits of electoral politics in the midst of a pandemic.

Thousands more stayed home, unwilling to risk their health during a statewide stay-at-home order, but complained that the absentee ballots they had requested were still missing.

Pregnant and infected with the coronavirus, 34-year-old Hannah Gleeson was still waiting Tuesday for the absentee ballot that she requested last week.

“It seems really unfair and undemocratic and unconstitutional, obviously,” said Gleeson, who works at an assisted-living center in Milwaukee. “It seems really absurd. And I think it’s voter suppression at its finest.”

The chaos in Wisconsin, a premiere general-election battleground, underscored the lengths to which the coronavirus outbreak has upended politics as Democrats seek a nominee to take on President Donald Trump this fall. As the first state to hold a presidential primary contest in three weeks, Wisconsin became a test case for dozens of states struggling to balance public health concerns with voting rights.

Joe Biden hopes the state will help deliver a knockout blow to Bernie Sanders in the nomination fight, but the winner of Tuesday’s contest may be less significant than Wisconsin’s decision to allow voting at all. Its ability to host an election during a growing pandemic could have significant implications for upcoming primaries and even the fall general election.

Results were not expected Tuesday night. A court ruling appeared to prevent results from being made public earlier than next Monday.

After several hours of voting, there were signs that the Wisconsin test was not going well.

Milwaukee, the state’s largest city, opened just five of its 180 traditional polling places, forced to downsize after hundreds of poll workers stepped down because of health risks. The resulting logjam forced voters to wait together in lines spanning several blocks in some cases. Many did not have facial coverings.

The election complications had a racial component.

Milwaukee is home to the state’s largest concentration of black voters, a community that has been hit harder than others in the early stages of the pandemic. Reduced minority turnout would benefit Republicans in a series of state and local elections.

Michael Claus, 66, was among the many voters who risked their health to vote. Claus, who is black, wore a protective mask and a Tuskegee Airmen cap.

He said he tried to vote absentee and requested a ballot in March, but it never showed up. His only option was to vote in person. He blamed the Republican-controlled state legislature.

“They could have delayed the election with no problem,” Claus said. “They decided if they can suppress the vote in Milwaukee and Madison, where you have a large minority presence, you can get people elected you want elected. And that’s sad.”

Democrats in and out of Wisconsin screamed for the contest to be postponed, yet Republicans — and the conservative-majority state Supreme Court — would not give in. The fight over whether to postpone the election, as more than a dozen states have done, was clouded by a state Supreme Court election also being held Tuesday. A lower turnout was thought to benefit the conservative candidate.

Lest there be any doubt about the GOP’s motivation, Trump on Tuesday broke from health experts who have encouraged all Americans to stay home by calling on his supporters to show up for the conservative judicial candidate.

“Wisconsin, get out and vote NOW for Justice Daniel Kelly. Protect your 2nd Amendment!” Trump tweeted.

Sanders said that holding the election was “dangerous” and “may very well prove deadly.” He did not encourage his supporters to vote in person. Biden has largely avoided discussion of the Wisconsin contest in recent days, instructing his supporters only to “follow the science.”

Wisconsin has reported more than 2,500 coronavirus infections and 92 related deaths — 49 of them in Milwaukee County, where the voting lines were longest.

The unprecedented challenge created chaotic scenes across the state — and a variety of health risks for voters and the elected officials who fought to keep polls open.

They included Robin Vos, the Republican speaker of the state Assembly, who joined more than 2,500 National Guard troops dispatched to help staff voting stations. While many voters stranded in lines for more than an hour did not have any protective equipment, Vos donned a face mask, safety glasses, gloves and a full protective gown.

In Madison, city workers erected Plexiglas barriers to protect poll workers, and voters were encouraged to bring their own pens to mark the ballots.

State GOP Chairman Andrew Hitt downplayed the health concerns: “This isn’t New York City.”

He noted that Wisconsin residents are still going to the grocery store, the liquor store and even boating stores classified as essential businesses. “I can’t really think of something more essential than voting,” he said.

As of midday Tuesday, most voting sites in Milwaukee were reporting wait times between one-and-a-half to two-and-a-half hours, according to Neil Albrecht, executive director of the Milwaukee election commission. Lines stretched several blocks outside buildings as workers tried to maintain social distancing recommendations that everyone stand at least six feet apart.

Tens of thousands of voters who received absentee ballots had not returned them as of Tuesday, Albrecht said. He noted that his office received hundreds of calls from people who didn’t get an absentee ballot or were concerned theirs hadn’t been delivered to election officials.

On the eve of the election, it was unclear whether in-person voting would happen at all.

Wisconsin Gov. Tony Evers issued an executive order Monday afternoon to postpone the election. Less than four hours later, the state Supreme Court sided with Republicans who said Evers didn’t have the authority to reschedule the race on his own.

Conservative justices on the U.S. Supreme Court quickly followed with a 5-4 ruling that overturned a lower court’s decision expanding absentee voting.

Evers himself had questioned whether he had the power to reschedule the election, but said the worsening situation, including an increase in COVID-19 deaths, made clear there was no way to safely move forward. The first-term Democrat said he sought the delay because he was motivated by protecting public health, not politics.

With the U.S. Supreme Court decision, voters were given no extra time for absentee voting. The court said absentee ballots must be hand-delivered by Tuesday evening or postmarked by Tuesday, although they can arrive at clerks’ offices as late as Monday. Wisconsin election officials said the high court’s order left intact a provision of the lower-court order that no returns be reported until that day.

As for the voters, one called it an “eerie” experience at the polls.

Christopher Sullivan, a 35-year-old high school business teacher from western Wisconsin, said two police officers greeted voters outside of his polling site in Holmen. Inside, two members of the county health department instructed him to wash his hands in a makeshift sink.

In another room, Sullivan was told to take one of the pens on a table spaced 6 inches apart and not give it back. He was given his ballot by “an elderly lady wearing a mask and gloves sitting behind a glass wall.”

“I have voted many times in my life (and at this location) and have never experienced something so eerie,” Sullivan said.

Peoples reported from Montclair, New Jersey. AP writers Gretchen Ehlke and Carrie Antlfinger in Milwaukee, and Amy Forliti and Doug Glass in Minneapolis contributed.