It’s not easy moving to a new state and defeating a popular senator, as Scott Brown (R) learned the hard way on Tuesday night when he fell to New Hampshire Sen. Jeanne Shaheen (D).

The race was called by ABC News and NBC News for Shaheen, denying the GOP what would have been a huge upset.

Had he pulled it off, the former Massachusetts senator — who lost to Elizabeth Warren in 2012 — would have been just the third person in American history to represent two different states in the Senate. The other two were last elected in the 19th century, according to the U.S. Senate Historical Office.

The race was tough for Shaheen in this Republican-friendly year in the Granite State, where President Obama is unpopular and where a large chunk of independent voters shift party preferences with the political climate. Brown consistently trailed but came within striking distance of victory toward the end.

A former governor and an institution in the state, Shaheen’s campaign boasted 20 field offices and a seven-figure investment — no small number in this small New England state with just 1.3 million residents. As her Democratic allies tell it, they were concerned, haunted by their wipeout in every national race (including for the Senate) in the last midterm election of 2010.

“We always knew this was going to be a close race,” Julie McClain, a spokeswoman for the New Hampshire Democratic Party, said before the polls closed. “It’s a difficult year and it’s a purple state. Our elections are always close.”

And Brown did make it remarkably close. Most polls down the stretch had the race within the margin of error, with Shaheen typically enjoying a narrow lead. The Cook Political Report declared the contest a tossup in the weeks. Brown left everything on the trail, from barnstorming coffee shops and highlighting Obama’s underwater job approval in the state, to relentlessly exploiting fears of border-crossers, ISIL terrorists and the Ebola virus.

Along with the advantages of the pro-Republican year, Brown talents as a retail politician always helped him in New Hampshire. “It’s a retail state,” Cook’s Senate editor Jennifer Duffy said two weeks ago.

Saving New Hampshire is an important consolation prize for Democrats, as operatives for both parties viewed this race as a bellwether for a GOP wipeout.

Correction: An earlier version of this article said the Associated Press had called the race earlier than it did. The AP called it at 9:19 p.m. ET.