Republicans held a congressional seat in rural Wisconsin and aimed to seize a Democratic one in suburban California as voters cast ballots in special elections Tuesday amid a pandemic that has upended all aspects of life, including political campaigns.

In Wisconsin’s 7th District, GOP state Sen. Tom Tiffany defeated Democratic school board member Tricia Zunker. With 88 percent of the precincts reporting, Tiffany held a comfortable double-digit lead in the GOP-leaning district, 58 percent to 42 percent, according to Edison Media Research.

Tiffany will fill the seat left vacant by Republican Sean P. Duffy, who abruptly left Congress in the fall, citing health complications with a child due in October. The child was born a month early and needed heart surgery.

The race for California’s 25th district hadn’t been called, but as of 11:30 p.m. with 76.3 percent of the precincts reporting, Republican businessman and former Navy pilot Mike Garcia led Democratic Assemblywoman Christy Smith 55.7 percent to 44.3 percent, according to Edison Media Research,

The California seat, which represents swaths of Los Angeles and Ventura counties, opened up in October when former Democratic congresswoman Katie Hill resigned amid scandal after wresting the seat from Republicans for the first time in 26 years.

The May race has garnered national attention as a test for Republicans desperate to win back the diversifying suburban areas that cost them the majority in 2018. President Trump has tweeted about the race several times, touting Garcia and disparaging Smith. Former president Barack Obama, Hillary Clinton and other Democratic heavyweights have tweeted their support for Smith.

“Remember, get out and Vote for Mike Garcia in CA25. A really big deal for our Country!” Trump tweeted as polls opened and retweeted an hour before they closed.

“Southern Californians in the 25th congressional district: Don’t forget to mail in your ballot today to choose @ChristyforCA25 as your new representative. She’s a leader who will fight to help families get through this crisis,” Clinton tweeted midday.

The winners in the Wisconsin and California races will finish the job through the end of the year but will have to face their opponent again in November to earn a full two-year term in Washington.

The candidates needed to adjust to a new normal, forgoing meet-and-greets and fundraisers for virtual town halls and social media and providing national parties a test case for what the November elections could look like if the novel coronavirus is still a major public health risk.

The vast Wisconsin district that spreads across 21 counties in the northern and central regions of the state supported Trump in 2016 by 21 points, making Tiffany the clear favorite to win again this fall.

Democrats were striving for the margin of victory to be closer than what lifted Trump four years ago, when he won the district and narrowly captured the state. The party was eager to argue that a tighter outcome would be evidence that Democrats would win the battleground state in November.

But in the California district, where Clinton bested Trump, minorities outnumber whites and voter registration favors Democrats, the race will be extremely competitive in the general election. National Democrats had sought to lower expectations about their chances in Tuesday’s election, citing historically low turnout by their voters. But they have remained bullish about Smith’s chances in November, when more of their voters will come out to oppose Trump.

If Garcia wins, Republicans will declare it evidence of their chances for greater success in reclaiming other seats Democrats flipped and winning back the majority. But Democrats argue that it is hardly indicative of what will happen in six months, when the electorate will be very different. Both parties and outside groups poured millions into the race.

As of 8 p.m. Tuesday, 34 percent of mail-in ballots had been returned — an extremely high rate for a special election — accounting for 46 percent of registered Republicans, 32 percent of Democrats and 23 percent of independents. The pandemic forced the counties to close almost all of their in-person polling places and instead mail every voter a ballot. To accommodate voters accustomed to turning out on Election Day, the district made 13 polling places available Tuesday.

Contention over location selection reached a national audience on Saturday when Trump weighed in against a last-minute decision to add a voting station in the city of Lancaster, Calif. Democrats, supported by the Republican mayor, argued that the large African American and Latino communities were being disenfranchised by not having a place to vote nearby.

Trump accused the Democrats of trying to rig the election, to which Smith shot back on Twitter: “In CA we believe in expansive voting rights. We also believe in states’ rights. Why don’t you Mr. President?”