Scott Walker, governor of Wisconsin, right, poses for a photograph during a campaign rally in Waukesha, Wis., on Nov. 5. (Daniel Acker/Bloomberg)

Democrat Andrew Gillum was defeated in his bid to become Florida’s first black governor Tuesday, but the party flipped at least seven governorships after voters rejected some Republican candidates in the Midwest and the Sun Belt, including in Wisconsin, Kansas and New Mexico.

At times choking up during a speech at Florida A&M University, Gillum conceded his race to Republican Ron DeSantis, who is closely associated with President Trump.

“I sincerely regret that I couldn’t bring it home for you,” he told his supporters.

Gillum performed relatively well in Florida’s cities and suburbs. But DeSantis won massive margins from Florida’s rural counties, underscoring the advantage Republicans continue to hold in statewide elections there. 

“Throughout the campaign, I knew the only thing I could control was how hard I worked,” DeSantis said in his victory speech. “And although I was confident in achieving a victory, I was at peace knowing I worked as hard as I possibly could, and I left everything out on the field.”

Including Florida’s, the 36 gubernatorial races on state ballots offered examples of America’s cultural and ideological divides under Trump. 

Democrats flipped the governorships in Wisconsin, Kansas, Maine, Michigan, Illinois, Nevada and New Mexico. The race remained too close to call in Georgia, where Democrat Stacey Abrams was running to become the first African American female governor.

In Wisconsin, Democrat Tony Evers bested Gov. Scott Walker, once a Republican star who ran for president in 2016. Walker survived a hard-fought recall vote in 2012, and was reelected in 2014, only to be denied a third term by the state schools superintendent.

In recent years, Walker has faced mounting voter concern about the condition of Wisconsin schools, but he also oversaw a robust state economy, including a 3 percent unemployment rate.

In Kansas, Democrat Laura Kelly defeated Secretary of State Kris Kobach, another Trump ally who is known for his unapologetic, hard-line views on immigration and who was the face of Trump’s anti-voter-fraud panel.

“This has been a battle to the finish,” Kobach said during his concession speech. “Headwinds all the way for our team. But that’s all right. We fought as hard as we could into those headwinds.”

In Illinois, Democrat J.B. Pritzker easily defeated Gov. Bruce Rauner (R) after one of the nation’s most expensive gubernatorial elections. Democrats also won the governorship in Michigan, where Gretchen Whitmer, a former state legislator, defeated Michigan Attorney General Bill Schuette to replace term-limited Gov Rick Snyder (R).

The Republican governor of Nevada, Brian Sandoval, was also term-limited, and will be replaced by Democrat Steve Sisolak, who won out over Republican Adam Laxalt. “Today, people from every corner of the state stood up and turned out to stay it’s time to bring people together,” Sisolak, a businessman and county commissioner, told supporters in a victory speech. “It’s time to prioritize our schools, our jobs and our health care. It’s time to stop the petty politics and get things done.”

New Mexico voters selected Democratic Rep. Michelle Lujan Grisham to replace outgoing Republican Gov. Susana Martinez. And in Maine, where Gov. Paul LePage (R) is term-limited, Democratic Attorney General Janet Mills defeated Republican Shawn Moody, a businessman. 

But Democrats were nervously watching results in several other states. Abrams was trailing in her bid for Georgia’s governorship against Secretary of State Brian Kemp, a conservative Republican whose office has been accused of trying to suppress voter turnout. Kemp had a sizeable lead, but some counties had yet to complete counts in the Atlanta metro area.

In a speech early Monday morning, Abrams refused to concede the race and said she was prepared to face Kemp in a runoff.

“If I wasn’t your first choice, or if you didn’t make a choice at all, you’re going to have a chance to do a do-over,” said Abrams, who referenced attacks on voting rights that threatened minority votes in recent weeks. 

“Some have worked hard to scare us away,” she said, “but we see the finish line.”

Republicans currently hold 33 of the nation’s 50 governorships. Of the 36 gubernatorial races on the ballot Tuesday, Republicans were defending 26 of them. 

The outcomes of those contests will have major implications for Democratic efforts to build a state-level firewall against some of Trump’s policies, including his effort to overturn the Affordable Care Act and gut environmental and labor laws. In most states, governors and state legislatures will be drawing new congressional boundaries after the 2020 Census. 

Several of the most hotly contested gubernatorial races took place in Midwestern states that formed the linchpin of Trump’s 2016 victory. Democratic leaders in those states view those contests as a major test of whether the party can win back the white working-class voters who abandoned the party in droves that year. 

In Pennsylvania, Gov. Tom Wolf (D) beat Republican Scott Wagner, a former state legislator, in a state Trump carried by 44,000 votes two years ago.

In Ohio, Democrat Richard Cordray, a former Obama administration official, lost to Republican Mike DeWine for the seat left open by term-limited Gov. John Kasich (R). The contest was widely viewed as a dead heat heading into Tuesday as Cordray and DeWine, the attorney general of Ohio, battled over health care, jobs and the state’s opioid crisis. 

In Iowa, Gov. Kim Reynolds, a Republican, defeated Democrat Fred Hubbell.

Iowa has been trending Republican, including supporting Trump by about 10 percentage points in 2016. Hubbell sought to take advantage of voter unease over access to health insurance and the president’s trade war with China, which could impact the state’s agricultural community.

Republicans had additional reasons for optimism on Tuesday.

On the East Coast, Republican Govs. Larry Hogan of Maryland, Charlie Baker of Massachusetts and Phil Scott of Vermont, all moderates, won reelection.

In New Hampshire, Gov. Chris Sununu (R) defeated his Democratic challenger, Molly Kelly, a former state senator.

Republicans also saw an opportunity to win back the governor’s mansion in Connecticut, where incumbent Dannel P. Malloy (D) decided not to seek a third term. 

Democrat Ned Lamont and Republican Bob Stefanowski, both businessmen, battled in a race that heavily focused on taxes and the state’s projected $2 billion budget deficit. 

In Oklahoma, Democrat Drew Edmondson lost to Republican businessman Kevin Stitt, who campaigned as a strong supporter of Trump. 

And in South Dakota, Democrat Billie Sutton — a former rodeo star who was paralyzed in a 2007 riding accident — lost to Republican Rep. Kristi L. Noem.

The Democratic incumbent who seemed most at risk of losing this year was Gov. Kate Brown (D) in Oregon, but she handily beat her opponent, Republican Knute Buehler.

Correction: An earlier version of this story misidentified Gov. Chris Sununu’s opponent. It has been corrected.

Robert Samuels in Tallahassee, Vanessa Williams in Atlanta, and Annie Gowen, Scott Clement and Isaac Stanley-Becker in Washington contributed to this report.