The champions raced into a 4-0 lead at the Etihad Stadium but were pegged back to 4-3 before producing a strong finish to settle a Premier League classic.
The victory was City’s ninth in succession and opened up a six-point lead at the top of the table, but Guardiola conceded he could hardly breathe easily.
The Spaniard said: “It was a rollercoaster, a typical Boxing Day (game) with a lot of goals. For everyone it was an entertaining game.
“It’s another victory, so important to continue our run, but it was weird. Even at 4-0 in the first half, every time they had the ball they arrived in the final third and created chances.
“The game was open even at 4-0. It was not closed. They are big club with a lot of quality and in the second half they changed the shape.
“We know the quality they have in the build-up. They have a top, top side and we know they have been good in the last years. They have always been so difficult and they have an exceptional manager.
“How clever it was to change shape and they created a lot of problems.
“At 4-2 the mindset of the players changed and at 4-3 the game was close to being equalised, or even (them) winning the game, because their mindset was high and we had doubts.
“But we were patient and we had chances, and from set-pieces we won the game.”
City cruised through the first half with goals from Kevin De Bruyne and Ilkay Gundogan in open play and penalties by Riyad Mahrez and Raheem Sterling.
Leicester hit back after the break through James Maddison, Ademola Lookman and Kelechi Iheanacho but Aymeric Laporte eased home nerves and Sterling wrapped up the scoring with his second.
Foxes boss Brendan Rodgers, who had been without a number of players through injury, was pleased with the spirit shown by the visitors in the second half.
Rodgers said: “We came in at half-time and the scoreline didn’t reflect the game. They’d had nine shots and we’d had eight but we were 4-0 down and in a tough position.
“We made a change and we challenged the players, we said we needed to try and win the second half and show the mentality and character in the team.
“We are a team that never unravel mentally and physically and that would be an easy thing to do, but the players showed an incredible spirit and played some great football to get to 4-3. Even at 5-3 we had two really good chances.
“It was a big ask against the champions who had had a free week to prepare and didn’t have too many players missing, but the players took that on and I was so proud of them.”