Danny Ward came off the bench to score a late winner for Cardiff City at Bristol City to strengthen the Welsh club's hold on their Championship play-off place.
The visitors had most of the limited scoring opportunities in a gritty first half, though both sides sharpened their attacking threat after the break.
Cardiff midfielder Will Vaulks had a shot well saved by Daniel Bentley, before a volley from Bristol City's Nakhi Wells was brilliantly stopped by Alex Smithies.
Robins substitute Filip Benkovic missed a glorious chance when he headed wide from a corner and, with five minutes left, his miss was punished as Lee Tomlin threaded a perfect through ball for fellow substitute Ward to finish clinically.
That was the 16th goal scored by a Cardiff substitute this season, more than any other team in the Championship.
And it was a particularly valuable one, increasing the sixth-placed Bluebirds' advantage over Derby County in seventh to three points.
For Bristol City, however, a fourth successive defeat effectively ends their hopes of reaching the play-offs, keeping them 12th in the table and now nine points adrift of the top six - resulting in the dismissal of boss Lee Johnson following the game.
Before lockdown his team were only a point outside the play-off places, but their miserable form since the season's resumption has derailed their bid for promotion.
Cardiff, by contrast, are now unbeaten in five games and growing in confidence as they aim for an immediate return to the Premier League.
Neil Harris' side started positively at Ashton Gate, with Nathaniel Mendez-Laing's low shot deflected wide and striker Callum Paterson getting behind the home defence on a couple of occasions.
Bristol City threatened from set-pieces - Zak Vyner heading their best chance straight at Smithies - but it was the visitors who looked likeliest to score.
A flurry of first-half opportunities saw Dion Sanderson, Joe Ralls, Mendez-Laing and Junior Hoilett all have shots blocked from promising positions.
As was the case in their goalless draw with Charlton in midweek, the Bluebirds lacked a cutting edge.
There was more incision to their play in the second half, a neat move involving Ralls, Joe Bennett and Hoilett ending with a shot from Vaulks which was tipped over by Bentley.
That save was then trumped by his opposite number as Smithies did superbly to reach Wells' acrobatic volley and palm it away for a corner.
With less than 10 minutes left, Bristol City were even closer when Benkovic squandered his free header by directing it wide.
And that was to prove costly, as Tomlin proved Cardiff's chief creator once again, splitting the opposition defence with a pass which allowed Ward to apply a firm, first-time finish with his left foot into the bottom corner.
Cardiff City manager Neil Harris: "We're really pleased.
On behalf of the group, the staff, the players, we dedicate that win for our fans who couldn't be there today.
We knew the importance of the game and what it means with the rivalry.
"It's been evident in the past four games, picking up 10 points, the importance of people coming off the bench.
"Danny Ward will be the first to admit that his goal comes to fruition because of the hard work Callum Paterson has put in for the first 79 minutes.