This came close to being the same old unwanted story for Pep Guardiola’s Manchester City. Until Gabriel Jesus’s 92nd-minute winner, it seemed an inability yet again to finish off sides, plus problematic defending, would prove costly.

First half brilliant; second half not. This was the pattern for City in a match they should have secured before the break. Instead, as with the 1-1 draws with Everton, Southampton and Middlesbrough in consecutive Premier League home outings in the autumn, Guardiola came close to ruing another victory eluding him.

When Gylfi Sigurdsson collected the ball in midfield and ran forward on 81 minutes there was an inevitability about the equaliser that followed. Now came a late rush for a winner and City’s spirit should be applauded.

Yet, as Guardiola said: “We were close not to winning the game at 1-1. I think in 90 minutes we deserved to win in terms of chances and conceding few and the way we play. The gap between the first and second half was too big. I remember what happened against Middlesbrough; it was similar. Today we were lucky to score in the last minute.”

Leroy Sané had given Swansea City the first scare, motoring along the left and pinging the ball on to Jesus, who scooped over. This presaged a period of incessant City pressure. Alfie Mawson tangled with Jesus in the area and Mike Dean waved away the penalty appeal, which appeared to be the correct decision from the referee. David Silva swung in a corner from the left and Swansea scrambled the ball away.

Then came the opener. Fernandinho, a midfielder by trade, was positioned at right-back and the left-field thinking was about to draw the best dividend by igniting the attack that led to the opener. The Brazilian put in a cross that a panicked visiting defence just about hooked away. From the ensuing play, Silva wriggled into the area and aimed the ball at Raheem Sterling. He could not finish but Jesus did, with a volley for a second goal in two games.

This, again, justified Guardiola’s thinking. After stating Jesus and Sergio Agüero could operate together, the head coach decided Swansea were not the opposition for this as the Argentinian was again on the bench.

This meant the XI chosen showed two changes from the midweek 4-0 win at West Ham United. In came Fernandinho and Gaël Clichy and out went Bacary Sagna and Nicolás Otamendi. Willy Caballero also retained his place, along with Jesus, as Guardiola decided Claudio Bravo needed more time out.

In City’s rocket-fuelled start blue shirts came at Swansea with frightening intent and all Paul Clement’s team could do was hang in there.

In the technical area Guardiola was a swirl of emotion. Pleasure mixed with frustration as he watched Sterling skim the ball in to the danger area but yield only a corner. Silva’s delivery found Yaya Touré but his first-time shot was wide.

This was attack-attack-attack with no end product. A dazzling short corner that involved Kevin De Bruyne interchanging passes with Silva closed with the Belgian failing to score. As the half moved towards the interval City faded and Swansea spent time in their territory. This was the concern for Guardiola: that Clement’s men could mount a smash-and-grab.

Guardiola ended the period chatting to Lee Mason, the fourth official, after Sterling was booked for diving over Lukasz Fabianski’s leg as his manager appeared to believe a penalty might have been given.

What Guardiola surely told all his players at the break was that they be more cut-throat. Yet at the start of the second half Swansea pinned them back. Caballero made a show-stopping save to his right to repel Sigurdsson. From the corner City were shaky andthere was relief when the ball came to Jack Cork and he blasted over.

City’s response was to shift up-field and they nearly benefited from a slice of luck when Sané’s cross became a shot that hit a post but there was no second goal.

This proved a rare foray forward, though. If Swansea were not as relentless as City’s first-half effort they were close. As the hour mark passed Guardiola wore the look of a man who has seen this all before. Swansea harried, then hurtled towards Caballero’s goal. When Sigurdsson drove in a corner from the right Mawson rose unchallenged and should have beat the keeper but his header was wide.

A lull ensued that was broken when City went close via Sterling and Aleksandar Kolarov. The sense they were just not finishing Swansea off strengthened after Silva dawdled and allowed time for a block on his shot and Guardiola wheeled away in fury.

The emotion deepened with Sigurdsson’s intervention. Now, Guardiola threw on Agüero but the last-ditch heroics came from Jesus.