The 24-year-old was formerly a regular in the heart of the Reds' defence alongside Virgil van Dijk before suffering a serious knee injury while on international duty with England in November 2020.
Gomez has since struggled to force his way back into Jurgen Klopp's starting lineup due to the form of Joel Matip and Ibrahima Konate's bright start to life at Anfield.
The versatile Englishman would fill in for Trent Alexander-Arnold at right-back last term, but Calvin Ramsay's arrival from Aberdeen led to suggestions that he could seek pastures new in the current window.
Newcastle United and Aston Villa were both linked with a move for Gomez, but the versatile centre-back has now committed his future to the Reds for another five years.
"It's obviously a special moment for me and my family. Another one that you dream of as a kid and one I don't take for granted," Gomez told liverpoolfc.com after signing his new deal.
"It is an unbelievable place to be; in my eyes, probably one of the best - if not the best - clubs in the world at the minute. The opportunity to extend my stay here was an easy decision to make, really.
"Obviously, I have been here quite a while now, but in the grand scheme of things I still feel young and, like you say, the best years are ahead of me. I have got more to learn and the time to do that.
"I think I have the platform here to do it with the manager and the coaching staff around me and my teammates, to make sure the best years are ahead."
Manager Klopp also expressed his delight that the "outstanding" Gomez penned fresh terms, adding: "Joe is an outstanding talent. He is also an outstanding defender and an outstanding human being.
"He has so many qualities, I could talk about them all day, so knowing that he will continue his journey with us is a massive boost - one that everyone who loves Liverpool FC and cares about its present and future should be unbelievably happy about.
"One of the many wonderful things about Joe is he has experience and youth - that's not a bad combination. He has not long turned 25 but he was at the club before I was and I think after Hendo and Millie he is our longest-serving player. Incredible. But the best thing of all is that his best years are still to come and I could not be happier that this will happen with us.
"In terms of right now, Joe is in phenomenal shape. We had a few weeks off and when I returned to AXA I saw him and my first thought was 'Wow!' Physically, he is in such a good place and now all he needs is a good pre-season and the rhythm that comes from this. Everything else is in place and I could not be happier that he will be staying with us for even longer."
Gomez was signed by Liverpool from Charlton Athletic in the summer of 2015 for a £4.4m fee, and the England international has since registered five assists in 142 games for the club, but he is still waiting for his first goal.
The ex-Addicks man has won the Premier League, Champions League, EFL Cup, FA Cup, Club World Cup and UEFA Super Cup during his time at Anfield, as well as winning the Under-17 Euros with England in 2014.
Gomez only made eight Premier League appearances in the 2021-22 season - starting four of them - but he has nevertheless followed the likes of Klopp, Mohamed Salah and James Milner in signing new deals this year.
After tying Gomez down to a new deal, Liverpool are now expected to intensify their efforts to agree fresh terms with forward Diogo Jota and midfielder Naby Keita before the 2022-23 season begins.