Sen. Cindy Hyde-Smith, a Republican who was appointed to the Senate this year, has defeated her Democratic challenger, former Rep. Mike Espy, in a special election runoff in Mississippi.

Hyde-Smith was expected to coast to victory in the runoff, but instead spent the days leading up to today’s election mired in controversy that evoked the state’s dark history of racism and slavery.

The election was held to fill the seat of Senator Thad Cochran, who retired earlier this year for health reasons.

With Hyde-Smith’s victory, Republicans will now have a 53-47 advantage in the senate, a gain of two seats in the midterm election.

In the House, Democrats have picked up 39 seats, with a potential to win 40.

That will put Democrats in charge of House come January.