Doug Jones has become the first Democrat in 25 years to win a US Senate seat.
The former lawyer beat Republican Roy Moore, who has been at the centre of sexual misconduct allegations.
Moore had repeatedly denied the claims against him and was controversially supported by US President Donald Trump.
Jones triumphed with 49.9 per cent of the vote, compared to Moore's 48.4 per cent.
Jones's win means Trump's Republican majority has narrowed to 51-49, which will make it even more difficult for him to push through his legislative plans.
Despite Moore refusing to concede at the time, President Trump surprised many when he sent a gracious tweet congratulating Jones on his seat.
He wrote: "Congratulations to Doug Jones on a hard fought victory. The write-in votes played a very big factor, but a win is a win. The people of Alabama are great, and the Republicans will have another shot at this seat in a very short period of time. It never ends!"