The 21-year-old Spanish defender joins from Anderlecht, with the left-back having made 49 appearances for the Belgian club across the 2021-22 campaign.
He then subsequently spent two seasons back in Spain on loan at Huesca helping the Club earn promotion to La Liga at the end of the 2019/20 campaign before then joining Anderlecht in the summer of 2021.
“I am incredibly proud and happy to have joined Manchester City," Gomez said.
“City are the best team in England and in Pep Guardiola I have a chance to learn and develop under the most outstanding manager in world football.
“To be able to be part of this club is a dream come true for me and something any young player would aspire to.
“The number of trophies City have won over the past few years has been incredible and the style of football the team plays under Pep is the most exciting in Europe.
“Playing for and being guided by Pep and his coaches is going to be very special.
“I've heard so much about the City fans and how passionate they are, so I can't wait to get started and to try and help the Club achieve even more."
Director of Football Txiki Begiristain added: “We are delighted to be able to welcome Sergio to Manchester City. He is a very exciting young talent.
“Sergio's development in recent seasons has been very impressive - he is an accomplished defender with great potential.
“Over the past year, he has gained excellent experience playing in the Belgian League and in Europe with Anderlecht.
“We're sure that he will bring additional quality to our squad both in defence and going forward and that he will only continue to develop and improve playing under Pep and his coaches."