Guardiola has signed a two-year contract with City which will keep him at the club until 2027.
The 53-year-old Spaniard joined City in 2016 and has won 18 trophies, including six Premier League titles.
His contract had been due to expire at the end of the current season, and he signs a new deal on the back of defeats to Tottenham, Brighton, Sporting and Bournemouth.
“I felt I could not leave now. Maybe the four defeats was why,” Guardiola told the club’s website.
“I think we deserve, after four defeats in a row, to bounce back and try to turn the situation. I think we deserve to be here. I am not arrogant to say, but it’s the truth.”
Guardiola said he is determined to help City “overcome” their current difficult predicament and reach a level where they “are more stable and more consistent” to scale the heights of the past.
“We have to recover that because right now we don’t have it and that’s the target we have to do,” he added.