MINNEAPOLIS (AP) --  Rep. Keith Ellison has been elected Minnesota attorney general, surviving an ex-girlfriend's accusation of domestic abuse.

Ellison defeated Republican Doug Wardlow for an office that threatened to swing to Republicans for the first time in nearly half a century.

Ellison rose to national prominence as the first Muslim elected to Congress and last year became deputy chairman of the Democratic National Committee. He talked of using the attorney general's office to resist President Donald Trump's agenda.

Then his ex-girlfriend accused him of dragging her off a bed during an argument in 2016. Ellison repeatedly denied her allegations, but they helped make the race close, even though Wardlow was a virtual unknown.