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, Steve Marchand, the former mayor of Portsmouth.

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.

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