Election week in Maryland has been a whirlwind in which Democrats both celebrated making history and found themselves swept into Republican President-elect Donald Trump’s extraordinary comeback.

Democratic Vice President Kamala Harris quickly won Maryland on her way to losing the country.

Prince George’s County Executive Angela Alsobrooks beat former Republican Gov. Larry Hogan to become Maryland’s first Black woman elected to the U.S. Senate.

As Maryland election officials finish tallying some remaining mail-in and other ballots, here are some takeaways from the state’s nearly complete but unofficial election results.

Maryland was not immune to Trump’s gains

Maryland backed Harris with a solid win — an expected outcome for a state that hasn’t delivered its electoral college votes to a Republican nominee since George H.W. Bush in 1988.

But it also wasn’t immune to the red wave that showed Trump performing better than he ever had in all types of areas across the country.

Harris performed worse than Biden did four years ago in every county in Maryland by a margin of about 4 to 16 percentage points, according to an analysis by The Baltimore Sun of the unofficial results. Those margins, and others, could still change after a couple hundred thousand remaining mail-in ballots are counted starting Thursday.

Her statewide win means she had about a 10.5 percentage point smaller winning margin than Biden’s landslide in the state.

Though results in other states were also still being tallied, that shift was in line with some other deeply blue states that gave Biden his biggest wins in 2020.

California and New York, for example, both moved toward Trump by a similar 12 percentage points, according to the initial results. The only other states that gave Biden bigger wins than Maryland — Vermont and Massachusetts — also saw narrower wins for Harris, by about 4 percentage points and 8 percentage points, respectively.

Trump areas getting redder

Part of that national trend appeared to be Republican-voting areas in the state moving faster toward Trump than other Democratic-leaning spots.

Of the 13 Maryland counties Trump won in 2020, his margins there improved by an average of 10 percentage points this year, compared to about 7 percentage points in the other 10 jurisdictions that he previously lost, according to The Sun’s analysis.

Cecil and Somerset counties, two areas that in recent decades have moved away from the Democratic Party at a faster rate than other parts of the state, showed the biggest swings toward Trump, according to initial results.

Cecil County, in the northeast corner of the state right alongside Biden’s home turf of Delaware, reported nearly same number of votes for Trump as it did in 2020 — about 29,400 — but 30% fewer votes for the Democratic nominee, dropping from nearly 17,000 votes to 11,500 votes with all precincts reporting but mail-in ballots outstanding.

In Somerset County on the lower Eastern Shore, Trump roughly doubled his winning margin from 2020, from 15 percentage points to almost 30 percentage points.

Trump’s gains and Harris’ failings were relatively smaller but still noticeable in most of the largest and most Democratic counties, like Baltimore city and Baltimore, Howard, and Prince George’s counties. Each of those moved toward Trump by about 6 or 7 percentage points.

A slight exception appeared to be Montgomery County, the most populous county and where Biden won 60% of the vote in 2020 but Harris won about 50% this year. After about 420,000 Montgomery County voters picked Biden and 101,000 picked Trump in 2020, about 127,000 fewer picked Harris this year and 8,000 fewer picked Trump.

Hogan outperformed Trump but lagged from gubernatorial years

With polls showing Hogan remained largely popular since leaving the governor’s office two years ago, the Republican was confident during his campaign that he’d perform better in Maryland than Trump.

That result came true Tuesday — just not at the level he needed for, as he said, the biggest upset in the country.

Hogan won more votes than Trump in all but three counties, ultimately securing about 198,700 more votes than Trump statewide and Alsobrooks securing about 196,000 fewer votes than Harris.

Ticket-splitting had been Hogan’s top goal in a state that he knew would go to Harris. And the unofficial results indicate he made some inroads in Democrat-heavy areas that he targeted during his campaign.

In the seven counties with the most number of Democratic voters, he won between about 10,100 (in Baltimore) and 42,800 (in Montgomery County) more votes than Trump.

But Hogan faced headwinds compared to his previously successful runs for governor in 2014 and 2018, when turnout was lower than presidential years, he was not on the ballot alongside Trump and when he faced different opponents under different circumstances.

The unofficial results from Tuesday night show he won a smaller share of the vote in every county compared to his resounding re-election victory by 12 percentage points in 2018.

That included, for example, his home county of Anne Arundel. Though he won the large, Democrat-majority county, 54% to 43%, it was a far cry from his 69% to 30% win over Democrat Ben Jealous there in 2018.

Western congressional district coming down to the wire

In a state where nearly 2.5 million votes rolled in for the top races, the outcome of one major race is still coming down to a few hundred votes.

Democrat April McClain Delaney was leading Republican Neil Parrott in the 6th Congressional District by 348 votes as of Thursday evening, out of more than 320,650 counted.

The district covers Republican-heavy western Maryland and parts of more evenly split Frederick and Democratic Montgomery counties. It’s routinely host to the closest congressional races in Maryland, where the other seven districts typically see the winners emerge with 60% to 80% of the vote.

If Parrott wins after the final mail-in votes are counted starting Thursday, Maryland would have two Republican congressional members for the first time since GOP U.S. Rep. Roscoe Bartlett was ousted in the same 6th district seat by Delaney’s husband, Democrat John Delaney, in 2012.

It would also push Republicans closer to keeping control of the U.S. House. Several districts remain up in the air, but Republicans have flipped more seats than Democrats and were more likely than not on Thursday to keep control when the next session begins in January.

This year’s matchup for the Western Maryland seat was the first time the district was open since Republicans gained ground in the district following the 2020 census and redistricting.

Outgoing U.S. Rep. David Trone beat Parrott in the last two election years, and the last time a race there or anywhere in Maryland’s congressional landscape was remotely close was in 2014, when John Delaney won reelection by about 2,800 votes, or 1.5 percentage points.