Foden has come through the club's youth ranks to make 182 appearances, scoring 52 goals in the process.
The 22-year-old has won four Premier League titles, four League Cups and one FA Cup with Pep Guardiola's side.
Foden has been named the PFA's young player of the year in each of the last two seasons.
His previous contract would have expired in the summer of 2024.
"It's hard to put into words how happy I am to have signed this contract," the England international told Man City's official website.
"It's a dream come true.
"I have been a City fan all my life. I've trained here for so many years and I've even been a ballboy. I love this club so much, so to know I am going to be a part of it until 2027 feels amazing.
"I've improved a lot in recent years and so much of that is down to Pep and his staff, who guide me every single day on the training field. Working with them gives me the best chance of improving even more and becoming the best player I can be.
"With the squad we have here, I feel I can keep learning and winning trophies. Those are the two most important things to me.
"I want to thank every single person at City because without them I would not be where I am today. All the Academy coaches I worked with, all the players I've played with and everyone who works behind the scenes. It's an honour to be part of this football club."
Director of football Txiki Begiristain added: "We are all so proud of Phil and what he has achieved already - but we know there is so much more to come.
"His natural talent and ability are obvious, but his hard work, professionalism and dedication make him really special. He loves football more than anything and his desire to improve is really incredible.
"We feel he can progress further and become even better than he is today. By signing this contract, he now has stability and can focus absolutely everything on becoming one of the best players in the world, which we feel he can be."
Foden has already scored seven goals and provided four assists in 13 appearances for Man City this season.