The central defender had two years remaining on his deal but Brendan Rodgers was keen to tie down his man amidst interest from other Premier League clubs.
Williams signed from Stockport in 2008 for a fee of £400k and has been an ever-present in the side since.
“I appreciate the fact the club wanted to extend my future here – it was definitely something I wanted to do,” he told the official site.
“It was one of the easiest contract negotiations I have had in my career. Myself and the club knew what we wanted and the talks were really relaxed.
“I had two years left, but this allows me to really focus on my football here and do as much as I can for the club.
“It’s great news, particularly as we are just days away from our first Premier League campaign.”