The 34-year-old Brazilian international was set to be a free agent in the summer with just six months left on his terms at the Etihad.
But his stay in Manchester will extend into an eighth season by the time his new deal expires in the summer of 2021.
Fernandinho has been a faithful servant to the Citizens since joining from Ukrainian side Shakhtar Donetsk in 2013, winning three Premier League titles and four League cups.
The former Atletico Paranense star will make his 300th appearance for Pep Guardiola’s men should he feature in the Carabao Cup semi-final second leg against Manchester United at the Etihad Stadium later on Wednesday.
Fernandinho has been deployed as a central defender for the most part of the 2019/2020 season following injuries to Aymeric Laporte and John Stones.
'I want to take this opportunity to put on record how grateful I am to my team-mates and the backroom staff here at City,' he told the club website.
'Without them, this deal would not be possible, so sincere thanks to every single one of them. This is the best possible news.
'My focus now is on making sure we continue to be successful. My time here has been decorated by silverware, but under Pep's guidance we have really accelerated. I want that to carry on for as long as possible.'
Fernandinho has played 26 times in all competitions for Manchester City this term.