Democrat Abigail Spanberger, a former CIA operative, has unseated Republican Rep. Dave Brat in a shocking upset for House conservatives, who have lost one of their stars.

Only four years ago, Brat pulled off one of the most stunning upsets in congressional history when he unexpectedly dethroned one of the most powerful Republicans in America, Eric Cantor, then the House majority leader, on the grounds that Cantor had grown too out of touch with the party. Since then, Brat has found his home in Congress in the ultra-conservative House Freedom Caucus, a group that has cultivated a close relationship with Trump.

Related 4 winners and 2 losers from the 2018 midterm elections

But this year, Spanberger ran on the same message, calling Brat too ideological and out of touch with his own district. And her moderate positions have made it hard for Brat to meaningfully ding her as too liberal for the district.

Who is Abigail Spanberger — and how did she win?

A former federal law enforcement agent and CIA operative, Spanberger supports a public option for health care, is against Medicare-for-all, opposes so-called sanctuary cities, and is very diligent about talking fiscal responsibility. She says Republicans rushed into unnecessary corporate tax cuts, but she doesn’t support repealing them. And when it comes to Trump, Spanberger’s team notably avoids any mention of investigating the president. She says that’s not a priority for voters in the district.

Meanwhile, Brat didn’t know what was hitting him. A week before Election Day, he was blaming the media for hyping up the “horse race” in the district.

“In this district, there hasn’t been any unease in the last four years when I ran,” Brat told reporters as he shook hands with constituents last week. “Health care is a big issue, but [voters] don’t know that because the newspapers won’t report any news. They report the horse race. Report the news.”

The story of Virginia’s Seventh District is in large part a story of Richmond’s urban sprawl. In 2017, the district was 70 percent white, 18 percent African American, 7 percent Hispanic, and 5 percent Asian. A growing tech scene and suburban development are rapidly changing this community, and a district that typically favors Republicans by 6 percentage points more than the national average is now tied in the polls.

There were parts of this district that didn’t vote for Trump in 2016. And Brat, who has both supported the president and seen his “strong endorsement,” has had a hard time separating himself from his hyperpartisan brand.

Brat’s problem this year was something House Republicans are facing across the country. Voters are unhappy with their health care repeal efforts last year. The tax bill Republicans passed is a flop with voters, too.

And Brat, who for the past two years has sat in one of Washington’s ideological power centers as a conservative lawmaker with close ties to Trump, has gained a reputation for being ideological to the point of obstructionist.

“He’s stood in the way of bipartisan legislation that is important to people in this district,” Spanberger said. “He has blown up the deficit. He has voted against spending bill after spending bill. He isn’t supportive of our workers. … He refuses to hold town halls. He doesn’t engage, and he lectures far more than he listens.”