Minnesota Democratic Rep. Keith Ellison has been elected as the state Attorney General, fending off his Republican opponent in an election mired with domestic abuse allegations.

Ellison, the deputy chair of the Democratic National Committee, defeated Republican Doug Wardlow and his ambitious run to become the first Republican state attorney general in nearly half a century. Ellison was once seen as the comfortable favorite in the race, but his campaign was thrown into turmoil when his former girlfriend accused him in August of physical and emotional abuse when they dated.

Karen Monahan claimed he once dragged her off a bed while shouting profanities and sent multiple abusive text messages. She published a 2017 medical document that identified Ellison as the abuser who caused “emotional and physical abuse.”

KEITH ELLISON DOMESTIC VIOLENCE ACCUSER POSTS 2017 MEDICAL DOCUMENT IDENTIFYING DEMOCRAT AS ABUSER

The Democrat denied the accusations and subjected himself to an investigation. Minnesota’s Democratic Party commissioned a probe that cleared Ellison of misconduct.

“He presented as sincere in his shock, hurt, and disbelief that Ms. Monahan would make these allegations against him,” a lawyer who investigated the allegations wrote in a report.

Ellison said in the report that his ex-girlfriend fabricated the domestic violence allegations because she is jealous of the congressman’s current girlfriend.

While The Democrat was supposed to be comfortable in the fight against Warlow, a little-known former state lawmaker who turned the allegations into a key campaign issue, polls showed the lead tighten

The Ellison accusations put Democrats in an uncomfortable position, as they took a strict stance concerning the sexual misconduct allegations against now-Supreme Court Justice Brett Kavanaugh.

Democrats have held the office for more than four decades, and Democrats had expressed concern that the allegations against Ellison could damage their chances in the race.

Fox News’ Kaitlyn Schallhorn, Adam Shaw and The Associated Press contributed to this report.