Josh Brownhill's stunner gave Bristol City their first Severnside Derby win in six with a 1-0 win at Cardiff.
Brownhill's strike in an attritional battle at the Cardiff City Stadium ended the hosts' unbeaten home start in a game lacking clear-cut chances, but where Neil Warnock's side struck the bar twice from range and perhaps deserved more.
Having started slowly, Cardiff improved and Junior Hoilett turned inside off the left and rattled the woodwork before half-time as they took control, and they were denied again after the break through Leandro Bacuna's 20-yard drive.
They were made to pay for those misses with time running out when Brownhill took aim from outside the box with 24 minutes left, and beat Neil Etheridge with a looping effort.
Bristol City go into the international break in the play-off places courtesy of a first win in three games, while Cardiff, who were booed off at full-time, remain in 14th.
Robins swoop to end Cardiff home record
Bristol City came out of the blocks the better in a typically tense derby between two rivals separated only by the River Severn, and perhaps could have led when Etheridge's poor clearance was seized upon by Brownhill, who got into the box before squaring for Marley Watkins whose shot was blocked by Aden Flint.
Midway through the opening period a succession of set pieces in the Bristol City half helped Cardiff grow into the game as their visitors struggled to clear their lines, and from then on in Neil Warnock's side took control.
They came within inches of taking the lead before half-time too when Hoilett cut inside his man, found a pocket of space 25 yards out and struck the far side of the bar, with Dan Bentley well beaten.
They continued their positional domination after the break without causing the visiting defence too many problems, only to rattle the woodwork with another long-range effort out of nowhere when Bacuna's dipping effort rebounded away off the goal frame.
Bristol City were barely getting into the Cardiff third but on one rare occasion Callum O'Dowda turned Curtis Nelson and shaped to shoot, only for the recovering defender to make an excellent block with the goal gaping.
They went one better with a shot from distance of their own soon after though, as Brownhill took a touch before lifting the ball over Etheridge, who was slightly off his line, for a superb opener.
Cardiff had scored six goals in the final 15 minutes of games this season but they were strangely lacking in intensity as they searched for an equaliser, with Nathaniel Mendez-Laing going closest as he danced through the visiting defence before Ashley Williams blocked his near-post effort.
That left the Bluebirds facing a first home defeat since they were beaten 3-2 by Crystal Palace in the Premier League on May 4, while Bristol City go into the international break back within five points of the top.
Man of the match - Josh Brownhill
Captain fantastic stepped up to the plate for Bristol City with a fine winner, having been his usual busy self with and without the ball over the course of the 90 minutes.
Brownhill made more passes than any of his team-mates, and more in the opposition half, while also winning the ball back nine times.