Erling Haaland scored a vital winner 19 minutes from time as Manchester City eventually broke Brentford's stubborn resistance to close within a point of the Premier League summit.
What looked set to be a night of frustration at Etihad Stadium for Pep Guardiola's men turned on a moment of huge fortune.
Brentford defender Kristoffer Ajer appeared to have the situation under control when Julian Alvarez played a pass into the visitors' half as City countered.
But as Haaland began the chase, Ajer slipped and could not regain his feet as the Norwegian sped past.
The 23-year-old kept his cool to beat Mark Flekken with a precise shot. It was Haaland's 22nd goal of the season and means he has now scored against every Premier League opponent he has faced.
More importantly, it secured a victory that took City above Arsenal into second spot and kept a record fourth consecutive title in their own hands given they still have to visit leaders Liverpool on 10 March.
While the result was not exactly harsh on Brentford given City's dominance, the manner of it was unfortunate. Thomas Frank's side were much more organised than they were in the heavy defeat against Liverpool at the weekend.
However, with six points from their past 11 games, they are only five points off the relegation zone and still searching for the sustained improvement that will get them away from trouble.
After failing to convert a succession of chances he would normally snaffle without a thought in the draw against Chelsea at the weekend, Haaland seemed like a man on a mission from the first whistle.
In the opening minutes he dropped deep to collect possession, overhit a pass to Alvarez, chased after it himself, then, as Brentford tried to play out, bullied Sergio Reguilon off the ball by the touchline before charging towards the edge of the box and driving in a shot that Flekken saved.
Not long afterwards, the league's top scorer sent an acrobatic effort over the bar.
While there may have been disappointment at not scoring on either occasion and understandable frustration at the limited number of sights at goal that followed as Brentford attempted to keep him quiet, there was always the sense that if anyone was going to break the deadlock it would be Haaland.
Phil Foden, hat-trick hero when these sides met in west London a fortnight ago, had a chance but ballooned his shot over the bar after being set up by Bernardo Silva.
So it was down to Haaland. Ajer - and Brentford - were unlucky in how the Norwegian got through. But once it was striker versus goalkeeper, the outcome was inevitable.
Haaland thought he had put City 2-0 up late on, but his close-range header was ruled out for offside against full-back Kyle Walker.
He is now two clear of Mo Salah in the Golden Boot standings. Whoever wins that personal battle will go a long way to deciding where the title ends up.
Brentford frustrate Guardiola
About half an hour into the game, after Brentford had again threatened the City goal, an audible grumble of anxiety rolled round the stadium.
Guardiola responded with half a dozen exaggerated 'calm down' hand signals waved in the general direction of the supporters directly above him.
By half-time, he was the one needing to cool off as he spun on his heels and marched down the tunnel.
The City boss had become increasingly irritated at what he felt were Brentford's time-wasting tactics, which, surprisingly in the era of double-digit injury-time, only brought a couple of additional minutes to the opening period.
In addition to retrieving the ball for a Brentford throw, Guardiola's response to Flekken's delayed goal-kicks and Yoane Wissa going down to earn John Stones a booking was to have a couple of long stares at opposite number Frank, someone the City boss said in his programme notes he 'really respects', chunter at the fourth official and offer a frustrated wave at referee Darren England.
It could have been worse. Ivan Toney was inches away from finding the target after Reguilon nudged a free-kick into his path while Frank Onyeka brought a full-length save out of Ederson.
After winning the corresponding fixture last season, Brentford's attempt to follow Manchester United as the only side to beat City in successive away games during Guardiola's time as manager was not fanciful.
For a brief moment at the start of the second half, as Onyeka led a break downfield, it seemed as though they would go in front, but he held on too long then ballooned his cross out for a throw on the other side of the pitch.
Brentford didn't properly threaten again until the fifth minute of injury time when they won a corner, which Haaland cleared.
It really was his night.
Source: BBC
BDST: 0447 HRS, FEB 21, 2024
SMS