The 21-year-old struggled for game time as Trent Alexander-Arnold's understudy in the first half of the 2021-22 season and was sent out on loan to Fulham to aid their promotion push.
Williams struck two goals and set up two more in 14 Championship appearances for the Cottagers and was expected to sign for the club permanently following their return to the Premier League.
However, Nottingham Forest moved quickly to secure the Wales international's signature after agreeing a reported £17m fee with Liverpool earlier this month.
Liverpool have now made the transfer official, bringing an end to Williams's 15-year spell at Anfield since the right-back joined as an Under-9s player.
After rising through the youth ranks at Anfield, Williams went on to make 33 appearances for the Liverpool first team in all tournaments, contributing six assists but failing to find the back of the net.
Williams won the Premier League, EFL Cup and Club World Cup during his time as a senior Liverpool player, and he has signed a four-year contract at the City Ground until the summer of 2026.
The defender posted a heartfelt farewell message on social media following his departure from Merseyside, saying: "15 years at this special club, thank you for everything @liverpoolfc it's been an honour to play for this club and to play under Jurgen Klopp. But I've now decided to take up a new challenge