But the gubernatorial elections were not all Democrats had hoped for, and they fell short of capturing the top jobs in an outright majority of states. Democrats were unable to mount strong campaigns against a trio of Republican governors in deep blue states: Charlie Baker in Massachusetts, Larry Hogan in Maryland, and Phil Scott in Vermont all won reelection easily.

In a potentially ominous harbinger for the 2020 presidential election, Democrats lost races they aggressively targeted in the battlegrounds of Florida, Ohio, and Iowa. In Florida, Andrew Gillum’s narrow defeat to the Donald Trump ally Ron DeSantis, despite Gillum holding a lead in most polls, was particularly stinging for progressives. And in Georgia, Stacey Abrams was fighting on Wednesday to get into a runoff election against the conservative secretary of state, Brian Kemp, who was just above the 50 percent threshold needed for an outright win.

Read: Stacey Abrams is still waiting for an unlikely miracle.

But the seven Democratic gains in governorships were the most for either party in a single year since 1994. Depending on the state, these wins will allow the party to either block conservative policies or implement progressive proposals on the state level that stand little chance of success in Washington’s divided national government.

They’ll also be crucial bulwarks in the party as it prepares for state-by-state redistricting fights after the 2020 census. In Wisconsin and Kansas, for example, the Democrats Tony Evers and Laura Kelly will be able to veto maps drawn by Republican state legislators and negotiate less gerrymandered districts.

“For the first time in a long time, a majority of Americans will now have Democratic governors working for them,” Governor Jay Inslee of Washington State, the chairman of the Democratic Governors Association, told reporters on a conference call. He noted that the seven states Democrats gained include 38 million people, giving the party a gubernatorial majority in population if not in states.

In addition to picking up seats from Republicans, Democrats defended all of their own governorships that were up for election on Tuesday night. Governors Andrew Cuomo in New York and Tom Wolf in Pennsylvania cruised to reelection, while in Colorado, Jared Polis joined Oregon’s Kate Brown (who also won reelection on Tuesday) as the nation’s only LGBTQ governors. Polis became the first openly gay man to win a statehouse. In Connecticut, the Democrat Ned Lamont narrowly avoided the party’s only net defeat, as he edged out the Republican Bob Stefanowski. Lamont’s win came 12 years after the liberal businessman made national headlines for defeating Senator Joe Lieberman in a Democratic primary, presaging Lieberman’s move rightward.

Republicans did make one gain. In Alaska, Mike Dunleavy beat former Democratic Senator Mark Begich to capture a governorship that the independent Bill Walker has held since 2015. Walker ended his reelection bid a few weeks ago when it became clear that he and Begich were splitting the anti-GOP vote.