Andi Weimann then scored his 13th goal of the season to add another but the deficit was reduced by substitute Max Watters though they could not mount a comeback.
City’s win gives them their first double over the Welsh side in 19 years and it was their first home win against them since November 2017.
Tale of the match
Nigel Pearson was forced into an early substitution as Robert Atkinson picked up an off-the-ball injury and Zak Vyner replaced him.
From an uncleared long-throw from Marlon Pack, Cardiff went near to a goal with Mark McGuinness heading against the post.
City’s treatment room grew bigger as Andy King was forced off with an injury with Pearson opting to bring on Jay Dasilva rather than midfielders Ayman Benarous or Joe Williams.
A lack of rhythm proved costly as Cardiff took the lead. Han-Noah Massengo cheaply gave the ball away to Tommy Doyle to cross to James Collins to head home.
Booed by the players for what was a sluggish start, they quickly changed the home fans mood with an equaliser. Martin curled home a rasping shot on the edge of the area for his first goal since October.
City then nearly took the lead as from a tight angle, Antoine Semenyo’s shot was blocked by Alex Smithies.
Just before the half was out, Martin’s header had to be cleared off the line by Aden Flint with the home side finishing the first period stronger.
There was a quiet opening quarter after the players emerged from the dressing rooms but it was City that went close to pulling in front, Antoine Semenyo’s low-driven shot forced Smithies to fumble.
It would be the home team that went in front and it was a goal that came out of nothing. Cardiff’s defence were caught at sixes and sevens as Weimann managed to tuck a ball through to Martin to thump home.
Semenyo had the chance to wrap the game up as City continued to pressure on the counter-attack but he blasted his attempt over the bar.
The ever reliable Weimann would do the job though as Semenyo would hold the ball up well to drive the ball home.
As the game moved into stoppage time, Cardiff gave themselves a glimmer of hope with substitute Watters scoring a header.
In the dying stages of the match, they away side had the chance to go level but Joe Ralls’ free-kick was tamed and straight at O’Leary whilst up the other end Semenyo hit the post, missing the chance to sure up the game. Fortunately for him he wouldn’t rue spurning that opportunity as the referee brought an entertaining match to an end.
Chris Martin: He’s a player that divides opinion when it comes to his inclusion in the side but today he merited his start. Taking his team forward, he scored City’s equaliser in fine fashion, picking the ball up on the edge of the box and directly guiding it past their goalkeeper.
It was like buses for him as after a three-month wait, he got a second goal. Not of the same quality as his first he scored a low strike from outside the box.
As well as his striking attributes, he also did well to defend against Cardiff from their corner kicks, where they were most dangerous.
South Stand Corner: With the big occasion like a Severnside Derby, the fans in the S26 and S27 blocks put on a display for the match. There were a number of flags that were waved to add colour to the end, as well as others draped around the corner. Nigel Pearson has said repeatedly this season that the fans can make the difference and that is what that corner is for, to create an atmosphere.
More than 21,000 fans came to the match that made it the highest attended match at the Gate this season.
Antoine Semenyo: No goals today and perhaps he should have had some of the chances he had but today he created two goals. Semenyo against a tough opponent in Aden Flint did a capable job. He held the ball up well to feed Weimann in for his goal and also played a part in Martin’s second.
After making his return from injury a few months back, he’s becoming an important player to how City function, but just needs to improve in the final third.
Aden Flint & Marlon Pack: This was the first time that the former Robins duo had played against Ashton Gate for the Welsh side with supporters in the ground. Neither player received a good reception from the fans who once adored them.
Out of the two it was Pack who got the worst reception from the home supporters. Pack was previously captain at the club and left directly for South Wales, compared to Flint who joined them from Middlesbrough.
Both players endured a difficult day with Flint part of a Cardiff defence that put in a sloppy performance.
Alex Smithies: The Cardiff goalkeeper was part of a backline that shipped three goals. On a few occasions he dropped the ball when the ball was easy to gather and he perhaps could have positioned himself better for Martin’s goal at least. Both he and Phillips do not hold the best record when it comes to saving shots when faced by them.
Bristol City (3-4-1-2): Max O’Leary 6, Tomas Kalas 7, Robert Atkinson 6, (Zak Vyner, 15;6), Cameron Pring 6, Alex Scott 6, Andy King 6, (Jay Dasilva, 27;7), Han-Noah Massengo 6, Callum O’Dowda 6, Antoine Semenyo 7, Andreas Weimann 7 Chris Martin 8.
Cardiff City (5-3-2): Alex Smithies 6, Cody Drameh 6, Mark McGuinness 6 (Isaak Davies, 72;6) Aden Flint 5, Curtis Nelson 5, Perry Ng 5, Marlon Pack 6, Joe Ralls 5, Tommy Doyle 7 (Ryan Wintle, 64;6), Mark Harris 6, James Collins 7 (Max Watters, 64;7)
Man of the Match
Chris Martin. Two goals gives him this accolade.
There’s two fixtures for Bristol City next week with a re-arranged trip to Kenilworth Road to face Luton up on Tuesday. They then make the trip up to Lancashire to face Preston North End next Saturday.