The 47-year-old Spaniard led City to glory in England, amassing a record 100 points.
The contract extension is highly significant as it is the longest commitment the ex Barcelona and Bayern Munich boss has made to a team since beginning his managerial career a decade ago.
"I am so happy and excited, it is a pleasure to work here," said Guardiola.
"I enjoy working with our players every day and we will try to do our best together in the coming years.
"As a manager, you have to feel good to be with the players - and I feel good."
City also won the English League Cup this year - defeating Arsene Wenger's Arsenal 3-0 in the final at Wembley Stadium.
"I will focus on the desire of my players to become a better team and every day that is what I will try to do - to improve on the pitch and improve our players," added Guardiola.
"We have a young squad with an average age of 23 and we want to keep taking steps forward and maintain the levels we have achieved this season."