BIRMINGHAM, Ala. (AP) – Democrat Doug Jones has won election to the U.S. Senate from Alabama, dealing a political blow to President Donald Trump.

Jones has defeated Republican Roy Moore, a one-time GOP pariah who was embraced by the Republican Party and the president even after facing allegations of sexual impropriety.

An attorney and former prosecutor, Jones rallied voters on a message of moving past the Moore controversies. He was buoyed by an influx of national Democratic cash and endorsements.

Jones’ victory is set to narrow the slim Republican majority over Democrats in the Senate to 51-49. His win in the Republican stronghold energizes the Democratic Party as it looks to build on anti-Trump sentiment to mount a challenge next year to Republican control of Congress.