Neil Warnock marked his first game as Cardiff City manager with a highly charged derby win over Bristol City.
Peter Whittingham’s nonchalant first-half penalty put Cardiff ahead after Craig Noone was tripped by Joe Bryan.
Debutant Sol Bamba bundled in from close range to double the Bluebirds’ lead, only for Lee Tomlin’s powerful strike to give Bristol City hope.
Tempers flared late on but Cardiff held on to climb out of the relegation zone and up to 19th in the Championship.
After a run of three successive league wins, Bristol City’s defeat sees them stay fifth in the table.
For Warnock, who succeeded Paul Trollope as Cardiff boss, the gutsy display and visceral atmosphere made for a dream start.
The former QPR manager had already made his mark on the squad before a ball was kicked, having signed Bamba, Junior Hoilett, Marouane Chamakh and Kieran Richardson on free transfers within a week of his appointment.
After a subdued start, the match came to life with a moment of opportunism and skill from Noone.
He was lucky not to be ruled offside before nutmegging Bryan and drawing a foul which led to the penalty that Whittingham lazily stroked into the bottom corner on 25 minutes.
Bristol City might have felt aggrieved Noone was not flagged offside, but Lee Johnson’s side struggled to replicate the form which had seen them win their previous three Championship fixtures.
Their task became harder when Bamba – imperious defensively – volleyed in from close range after Sean Morrison’s shot had hit the bar midway through the second half.
The visitors fought back immediately with Tomlin’s swerving 20-yard shot but, with Cardiff’s Lex Immers lying on the ground as the ball went in, the goal sparked a melee which saw the hosts’ Aron Gunnarsson and Tammy Abraham of Bristol City both booked.
Bristol City had a glorious late chance to equalise but substitute Bobby Reid shot over the bar from just a yard out.
Bristol City head coach Lee Johnson told BBC Radio Bristol: “We’re hurting – it’s a derby and we didn’t want to lose it.
“We were really poor in the first half and I didn’t feel that we played our game.
“It’s disappointing, but in the big picture, we’ve still had a decent start and we have to learn our lessons from this one.”
Match ends, Cardiff City 2, Bristol City 1.
Second Half ends, Cardiff City 2, Bristol City 1.
Offside, Cardiff City. Lex Immers tries a through ball, but Anthony Pilkington is caught offside.
Lex Immers (Cardiff City) is shown the yellow card for a bad foul.
Attempt blocked. Joe Bryan (Bristol City) left footed shot from outside the box is blocked. Assisted by Lee Tomlin.
Attempt missed. Luke Freeman (Bristol City) right footed shot from outside the box is close, but misses to the left.
Attempt missed. Bobby Reid (Bristol City) right footed shot from very close range is too high. Assisted by Joe Bryan with a cross.
Foul by Mark Little (Bristol City).
Anthony Pilkington (Cardiff City) wins a free kick in the defensive half.
Mark Little (Bristol City) is shown the yellow card for a bad foul.
Foul by Mark Little (Bristol City).
Lex Immers (Cardiff City) wins a free kick in the defensive half.
Substitution, Cardiff City. Anthony Pilkington replaces Rickie Lambert.
Foul by Aden Flint (Bristol City).
Aron Gunnarsson (Cardiff City) wins a free kick in the defensive half.
Gary O’Neil (Bristol City) wins a free kick in the attacking half.
Foul by Kadeem Harris (Cardiff City).
Joe Bryan (Bristol City) is shown the yellow card for a bad foul.
Foul by Joe Bryan (Bristol City).
Craig Noone (Cardiff City) wins a free kick in the defensive half.