It had appeared that Oriol Romeu’s equaliser had cut Manchester City’s lead at the top of the table to six points until the 95th minute when a short pass found Sterling on the edge of the area.
The England forward, scorer of an 88th minute winner against Feyenoord and an 84th minute against Huddersfield in the past week, curled a magnificent shot into the top corner from the edge of the area to spark seismic celebrations on the field.
Guardiola himself sprinted into the middle of the field and then, on the final whistle, was engaged in an angry exchange with Southampton’s Nathan Redmond — an incident which may be of interest to the powers that be.
“It was an astonishing end to the game,” Guardiola said. “It means a lot. They had 10 guys in the box, it was so complicated to attack them.
“They had chances in the first half, all the teams are better than us at set-pieces. They are stronger than us but we kept patient.
“At the end our momentum kept going, Raheem scores a fantastic goal.
“What impresses the most is the heart with which they play. What happened in the locker room was amazing. You have to enjoy these situations, you never know what will happen in the future. We want to win the league but you have to celebrate when you score in the last breath like that.
“I was telling Nathan Redmond how good he is at the end. Southampton have some super talented players, Redmond is so good one against one. But they didn’t’ want to play, they were time wasting from the ninth minute. I just wanted them to play.”
The late drama happened after Romeu had struck clinically from 10 yards, 15 minutes from time, as Fabian Delph badly misjudged a Ryan Bertrand cross and substitute Sofiane Boufal skipped past him and centred for the Spaniard to score.
The home side had responded impressively after a lacklustre first half, one which presumably would have earned the players a hot reception from the demanding Guardiola at the interval.
Within 80 seconds of the restart, City were ahead from a De Bruyne free-kick, wide on the left, which was so brilliantly struck that it appeared certain to cause trouble inside Southampton’s six-yard area.
Virgil van Dijk was the unfortunate Southampton defender who made the telling touch, arriving at the ball marginally before Nicolas Otamendi but he was unable to do anything but steer it into his own goal.
For all their dominance in practically every game so far this season, City could easily have found themselves a goal down to Mauricio Pellegrino’s side in what was, by their standards, a poor first half.
Ryan Bertrand’s 14th minute corner was flicked on at the near post by Maya Yoshida, finding Wesley Hoedt who appeared to have done enough to steer his own header into the City goal, only for the ball to strike the cross-bar.
Immediately following that narrow escape, City showed the threat they pose on the counter-attack, breaking upfield at electrifying pace for Raheem Sterling to test Fraser Forster with a shot the goalkeeper parried.
The rebound fell kindly for Gabriel Jesus whose first-time effort drew another fine diving block from Forster, who had recovered well.
A dangerous free-kick from Nathan Redmond found Shane Long’s head, although City cleared the danger, and the Premier League leaders were gradually beginning to take control of proceedings.
De Bruyne picked out Fernandinho for a shot which Forster, again, did well to keep out but, as the visitors failed to clear, De Bruyne worked his way down the by-line before crossing for Otamendi to head over from close range.
In the 25th minute, City came closer still as Ilkay Gundogan’s clever backheel set up Gabriel Jesus for a shot which Forster again did brilliantly to keep out.
But City failed to make that pressure count and, as the half wore on, the Saints began to present Guardiola’s men with some anxious moments.
Mario Lemina darted into the City area, pushing the ball through the legs of Vincent Kompany, before forcing Ederson into a comfortable save at the foot of his post.
And, within a minute, van Dijk headed down a left-wing corner, directly to Yoshida whose first-time volley flew high over the goal from only five yards.
It was a different story after the break, with City taking an early lead and, within a minute, they could have been two-up as Gundogan played in Jesus who switched from left to right foot and rolled a shot just wide.
Gundogan shot wide from 20 yards and, in quick succession, Forster saved impressively to deny Jesus, played in by Aguero, and De Bruyne.
With De Bruyne’s expert set-piece delivery a constant threat, Aguero rose to meet a free-kick which he headed just over while a long shot from Fernandinho forced Forster into another solid piece of goalkeeping, as he dived to his left to save.
Guardiola brought on the Silvas, David and Bernardo, from the bench but, despite improving City’s possession statistics even further, they were unable to carve out a meaningful opening until the late drama.
Ederson 6; Walker 7, Kompany 5, Otamendi 6, Delph 6; De Bruyne 8, Fernandinho 7, Gundogan 7 (B Silva 80, 6); Sterling 7, Aguero 6, Jesus 7 (D Silva 74, 6).
Forster 8; Soares 6 (McQueen 87), Yoshida 7, van Dijk 7, Hoedt 7, Bertrand 7; Hojbjerg 6 (Boufal 64, 7), Romeu 7, Lemina 6, Redmond 6; Long 6 (Austin 82).