Democrat Joe Cunningham defeated Republican Katie Arrington for South Carolina’s 1st Congressional District early Wednesday, in a fiercely competitive race.

Katie Arrington, a state representative, beat incumbent Rep. Mark Sanford (R-SC) in the Republican primary, in a major upset.

She ran on a conservative platform and the district went for President Donald Trump in 2016 by double digits, but her opponent and Democrats argued that she was too far right for the district. Sanford is a Never Trump Republican.

During the race, Arrington was seriously injured as a passenger in a fatal car accident. She had multiple emergency surgeries and spent weeks in the hospital before finally returning to the campaign trail.

While she was recovering, national Democrats connected with House Minority Leader Nancy Pelosi and the Democratic Congressional Campaign Committee (DCCC) flooded South Carolina.

Cunningham is the first Democrat to take the district’s seat since 1981, according to The State. Cunningham, an attorney, positioned himself as a moderate who would reach across party lines.