Chris Martin netted a double as Bristol City came from behind to earn Severnside derby bragging rights with a 3-2 Championship win over Cardiff at Ashton Gate.
James Collins headed the visitors in front after 31 minutes from a cross by Tommy Doyle, who was gifted possession by a poor clearance from Han-Noah Massengo.
But the lead lasted barely a minute as Andreas Weimann broke through the centre of Cardiff's defence and when he was challenged the ball broke for Martin to level with a curling shot from 15 yards.
The inspired Martin was on target again after 63 minutes with a perfectly placed left-footed drive from the edge of the box after running onto an Antoine Semenyo pass.
Semenyo was also the provider when Weimann ran onto his pass to drill Bristol City's third from a narrow angle after 77 minutes, his 13th goal of the season.
Max Watters headed a 90th-minute consolation for Cardiff from a cross by fellow substitute Ryan Wintle, but it was too little, too late.
Robins manager Nigel Pearson named Rob Atkinson in the middle of a three-man back-line, with Massengo partnering Andy King in midfield.
Cardiff boss Steve Morison gave a debut to midfielder Doyle, on loan from Manchester City, while Aden Flint and Marlon Pack lined up against their former club.
The home side suffered an injury blow after just 16 minutes when Atkinson limped off to be replaced by Zak Vyner.
Mark McGuinness tested Robins goalkeeper Max O'Leary with a 14th-minute header and went closer four minutes later with another header that hit the outside of a post.
Pearson had to make a second change after 27 minutes when King gave way to substitute Jay Dasilva, who went onto the right flank with Alex Scott moving to central midfield.
Mark Harris had a 25-yard shot saved by O'Leary before the two goals in quick succession lifted an already vibrant atmosphere.
The best other effort before the break came from Martin, who had a 43rd-minute header cleared off the line from a Callum O'Dowda cross.
Neither side could fashion chances at the start of the second half until the 60th minute when Semenyo's fierce drive was saved by Cardiff goalkeeper Alex Smithies.
After Martin's second goal, Semenyo had a shot blocked following a strong Weimann run and then ended a swift break out of defence with another effort that struck the outside of the near post.
The young striker was having an increasing influence and out-muscled his marker to set up Weimann's clincher.
Watters' goal stretched Robins nerves in four minutes of stoppage time, but O'Leary saved a Ralls free-kick and Semenyo hit a post for the second time on the break from the last effort of an exciting game.
Bristol City: O'Leary, Atkinson (Vyner 16'), Martin, King (Dasilva 28'), O'Dowda, Weimann, Prinz, Semenyo, Kalas, Scott, Massengo.
Subs Not Used: Bentley, Williams, Wells, Conway, Benarous.
Cardiff City: Smithies, Drameh, McGuinness (I.Davies 73'), Flint, Nelson, Ng, Ralls, Pack, Doyle (Wintle 65'), Harris, Collins (Watters 65').
Subs Not Used: Phillips, Bagan, Morrison, Vaulks.