Famara Diedhiou ended Blackburn's seven-match unbeaten run with an 82nd-minute winner as Bristol City edged a Sky Bet Championship thriller 1-0 at Ashton Gate.
The striker had only been on the pitch for seven minutes as a substitute when he shot home on the turn after Callum O'Dowda had nodded down a Nahki Wells cross from the left.
It was rough justice on Rovers, who contributed much to a game full of attacking intent from both teams, but were let down by their finishing.
The only surprise about a wide-open first half was that it ended goalless as both defences looked vulnerable.
Bristol goalkeeper Dan Bentley had to make the first save of note after 14 minutes, diving full length to gather a low drive from Adam Armstrong at the second attempt.
Armstrong had a better chance moments later when breaking onto a through ball and cutting inside only to send his left-footed shot high and wide.
Bristol were soon creating clear opportunities at the other end. Antoine Semenyo fired wide after 17 minutes with a first-time effort from inside the box when he had time to take a touch.
Next it was O'Dowda getting in behind the visiting back-line onto an Adam Nagy shot, but his effort was wild from only eight yards and well off target.
Rovers claimed a penalty after 27 minutes when Armstrong got the first touch as he went through on the advancing Bentley, who just did enough to halt his progress, allowing a defender to recover and clear.
Semenyo, Chris Martin and Tommy Rowe all had shots for City, while Blackburn remained dangerous on the break without testing Bentley.
Rovers had the first chance of the second half, Harvey Elliott's shot from inside the box taking two deflections before a grateful Bentley smothered the effort.
At the other end, Wells chose to pass when in a good shooting position and a promising City move ended with Semenyo firing over.
Armstrong had a shot deflected for a corner as both teams continued to attack with menace. The Rovers top scorer was shooting on sight, without being able to find a finish.
O'Dowda was left holding his head for the second time when Martin teed up a great 59th minute chance. The midfielder's low shot was brilliantly blocked by former City defender Derrick Williams.
Wells sent a curling effort wide and Rovers keeper Thomas Kaminski saved from O'Dowda before another strike from Armstrong flew just wide of Bentley's goal.
Elliott had a shot deflected wide with Bentley off his line and from the resulting corner Daniel Ayala headed wide.
Wells shot wide for City from a tight angle and after Diedhiou's goal the home side had to defend gallantly in the closing minutes.