Josh Brownhill's long-range strike earned Bristol City a 1-0 Severnside derby victory over Cardiff.
Lee Johnson's side found themselves on the back foot for long spells in the Welsh capital but the Robins captain scored a decisive goal from 25 yards to send his side into the Championship play-off places.
The defeat meant it was more derby-day woe for Neil Warnock two weeks on from Cardiff's loss at the hands of rivals Swansea.
Their miserable run of one victory from their last six matches leaves them in 14th place, seven points adrift of the top six.
Joe Ralls played through the pain of a groin injury to net a hat-trick against Birmingham last weekend.
But this game proved too much for the midfielder who was replaced by former Robins playmaker Lee Tomlin.
Omar Bogle came in for the suspended Danny Ward up front as Marlon Pack captained the Bluebirds despite only moving across the border from Bristol City on deadline day.
Johnson opted for the defensive solidarity of three centre-backs with the inclusion of Nathan Baker in place of Taylor Moore.
Han-Noah Massengo dropped to the bench as Adam Nagy made a long awaited return from an ankle injury.
Cardiff goalkeeper Neil Etheridge almost gifted the visitors an early goal with a wayward clearance that went straight to Brownhill.
The midfielder took the ball into the Cardiff box and crossed for Marley Watkins, but Aden Flint scrambled back to deny his former employers.
Warnock's men grew in confidence after their early scare and thought their pressure should have resulted in a penalty when Baker tugged at Flint's shirt as he tried to meet Pack's corner.
While many were still protesting, Junior Hoilett picked the ball up 25 yards from goal and rattled the crossbar with a fierce curling shot.
The Bristol City woodwork was shaking again just before the hour mark after Leandro Bacuna unleashed a powerful effort from range that beat Daniel Bentley but clipped the top of the bar.
Bogle was the next Cardiff player to be denied by a last ditch Baker block, but just as Cardiff were turning the screw, Brownhill's bolt from the blue turned the game on its head.
Tommy Rowe nipped in to take the ball from team-mate Kasey Palmer and found Brownhill with time and space.
He took a touch and sent a dipping strike over Etheridge and into the back of the net for a 1-0 lead after 67 minutes.
Substitute Gary Madine had a chance to level with his first touch after rising to meet Pack's corner, but Bentley grasped the ball with both hands as Bristol City secured bragging rights.
Follow Sporting Life on social media - find us on Facebook here or tweet @SportingLifeFC
Related football links
- Liverpool v Man City: The Tactics
- Listen: Premier League Weekly Podcast
- Pundits on Liverpool v Man City
- Liverpool v Man City stat attack
- Listen: Championship Podcast with David Prutton
- Watch: PL MD11 highlights
- This Manager's Life: Sabri Lamouchi
- Super 6: Enter NOW!
- Fantasy Football: Pick your team now!
- Football results