The 23-year-old has scored 10 goals in 33 appearances across all competitions since completing his transfer from River Plate to Manchester City last summer.
In his short time as a Man City player, Alvarez has become a world champion with Argentina, scoring four goals as La Albiceleste triumphed in Qatar last year.
Alvarez's previous deal still had a significant number of years to run but Man City have nonetheless moved swiftly to ward off interest from rival clubs.
Alvarez told City's website: “This is a very proud moment for me and my family. For a club like City to put their faith in me like this is amazing.
“I have been really pleased with my first season here, but I have plenty more I can do. I know I can be better, and City offer me everything I need to fulfil my potential.
“I want to thank the manager, the coaches and everyone at City who works behind the scenes for everything they have done for me since I joined in the summer. I could not have asked for more. This is a club that looks after its players, and I have felt so supported throughout my time here.
“I am now focused on getting better and helping City win trophies.”
City's director of football Txiki Begiristain added: "Julian has impressed everyone at Manchester City with his technical ability, dedication and attitude."
"We saw at the World Cup what a special talent he is. To win that trophy at his age is amazing and we are all very proud of what he achieved.
"His progress so far has been really good, but we are now fully focused on developing his game even further and turning him into one of the best strikers in world football."