Incumbent Republican U.S. Sen. Cindy Hyde-Smith won her closely-watched runoff election Tuesday night in Mississippi, becoming the first woman elected to represent the state in the upper house of Congress. Despite having made a series of controversial statements, Hyde-Smith successfully fended off a serious challenge from Democrat Mike Espy in a deep-red state President Trump won by 18 points.

The Mississippi Secretary of State office said Hyde-Smith had 474,471 votes, or 53.9 percent of ballots cast. Espy had 405,486 votes, or 46.1 percent. A small number of precincts have yet to report results.

After Mississippi's runoff, Republicans now control 53 Senate seats, compared to the 45 controlled by Democrats (two Independent senators caucus with the Democrats). But Republicans also lost control of the House, where Democrats will assume the majority in January.

The victory by Hyde-Smith also means there will be 24 women in the Senate next year, setting a new record. Twenty-three women now serve in the Senate.

Hyde-Smith, a cattle farmer, had served as the state's senator for seven months after being appointed to fill the seat vacated Thad Cochran, who resigned in March due to health issues.

Democrats had hoped Espy might pull off an upset win after Hyde-Smith made a series of controversial comments about race in a state where the Confederate flag remain part of Mississippi's state flag.

Google, Walmart, Facebook, and Major League Baseball are among the companies that have asked for a refund of their campaign contributions after Hyde-Smith was recorded earlier this month referencing a public hanging.

"If he invited me to a public hanging, I'd be on the front row," Hyde-Smith said, referring to a Mississippi rancher who was supporting her campaign. She has refused to apologize for the comments, and said in a public statement, "any attempt to turn this into a negative connotation is ridiculous."

It's not the only controversy Hyde-Smith stirred up during the election. CNN reported that the embattled senator once promoted a state measure praising a Confederate soldier and pushed a revisionist history of the Civil War. A photo of Hyde-Smith wearing a Confederate hat and holding a rifle, which she posted on Facebook in 2014, has also re-surfaced. And the Jackson Free Press reported that the high school she attended was a segregated academy created by white parents who didn't want to send their kids to schools with black students.

Hyde-Smith was also caught on video suggesting that suppressing the rights of students to vote was "a great thing." Her campaign called her comments a "joke."

Trump won Mississippi by nearly 18 points in 2016, but the combination of Hyde-Smith's controversial remarks and the sagging popularity of the president — even in deep-red states — combined to make the runoff a closely watched election.

Espy had to deal with his own controversial past during the election. He was forced to confront his past lobbying work after Fox News reported he was paid $750,000 by the Ivory Coast in 2011 under former president Laurent Gbagbo, who is on trial at the International Criminal Court at The Hague for crimes against humanity. Espy said he was only paid $400,000 before ending his three-month contract after just a month on the job.

In 1994, Espy had been forced to resign as Agriculture Secretary after an investigation was opened into allegations that he received improper gifts. Espy was ultimately acquitted of all charges.