It was his 500th Premier League game in charge of the club - becoming the first manager to achieve that feat since David Moyes with Everton in 2013.
It was the perfect moment to break a run of bad form which has seen Manchester City only win one of their last 13 games.
A 2-0 victory was just what City needed with goals coming from Savinho and Erling Haaland.
Prior to joining Man City, Guardiola's longest stint at a Club was 247 matches for Barcelona from 2008 to 2012.
He then managed Bayern Munich for 161 games from 2013 to 2016.
READ MORE ON MAN CITY
'I was right' - Rory Jennings doubles down on Erling Haaland verdict amid dreadful run
'We have to' - Pep Guardiola gives major transfer update amid Man City's injury crisis
The Spaniard then arrived in Manchester the same year he left the German champions and has remained there since.
Guardiola succeeded Manuel Pellegrini and led the club to its happiest moments, including their first Champions League as part of their 2022/23 treble season.
He has six league titles, four league cups, two FA Cups and a Champions League.
Speaking ahead of his side hosting the Foxes, he said: "Sometimes you expect it will be easy to fix it but sometimes it will take more time.
Most read in Football
Salah overtakes Kane, Shearer and Henry to set incredible new Premier League record
Erling Haaland drops X-rated comment during interview after Man City win
Tottenham make unwanted Premier League history as pressure increases on Postecoglou
Every previous Man United manager has had 'issues' with Marcus Rashford
"I will not give up. I want to be here and do it. The situation we have, we have to do it.
"Now we go to Leicester, it has always been difficult but now the players will be ready to do it."
There were worries that the manager would be tempted to coach the Brazil national team, especially as he has achieved so much in England.
But he was convinced to sign a one year contract extension which will run until the summer of 2027.
"Since the beginning of the season I've been thinking a lot," Guardiola said in an announcement video. "I want to be honest, I thought this [season] should be the last one. But the problems we had in the last month, I felt now was not the right time to leave.
"I didn't want to let the club down. I felt I could not leave now, simple as that. Don't ask me the reason why.
A big hit to rivals such as Liverpool and Arsenal who have grown tired of Man City's prowess.
Guardiola has a long way to go until he becomes the club's longest serving manager. That goes to Les McDowall who was at the club for 13 years (1950-1963), taking charge of 592 matches.
By the time his contract expires he would have served 11 years and further solidified himself as arguably the greatest manager of all time.