Middlesbrough ended Cardiff's 11-match unbeaten run thanks to Faris Haroun's worthy winner at the City Stadium.
The Belgian midfielder ghosted between two defenders to fire through the legs of Cardiff goalkeeper David Marshall.
Bart Ogbeche had given Boro the lead with a deflected shot, but Ben Turner headed an equaliser from a corner.
Cardiff went ahead when Kenny Miller's backheel picked out Aron Gunnarsson, only for Scott McDonald to side-foot Boro level before Haroun struck.
The win, which sees Boro leapfrog their hosts into third in the Championship, echoed their three-goal victory in Cardiff last season that derailed the Bluebirds' play-off bid.
Signs that this would become a full-blooded encounter came early, when Middlesbrough striker Ogbeche threw himself at Haroun's teasing cross.
Cardiff centre-back Mark Hudson was no less committed, and the heads of the two players came together with a worrying thud. Thankfully, both were able to carry on after treatment.
Cardiff, in front of a season-high 23,373-strong crowd, were left exasperated when Kevin McNaughton nicked the ball past Jason Steele in the area and seemed to be clearly felled by the goalkeeper, only for referee Graham Salisbury to wave away the penalty appeals.
The home side's sense of injustice was compounded as Middlesbrough took the lead moments after.
Ogbeche cut inside from the left and unleashed a pile-driver that took a wicked deflection off Hudson and spun in past Marshall.
But Cardiff were soon level as Peter Whittingham's corner was flicked on by Miller at the near post, allowing centre-back Turner to head home his first goal for the Welsh club.
Then moments before half-time, Miller ran at the heart of the Boro defence, taking two defenders with him before backheeling into the path of Gunnarsson, who shot past Steele from close range.
But while Boro boast the best defence in the division, they showed their attacking prowess in the second half.
McDonald nodded wide of the left-hand post after 50 minutes, before McNaughton blocked Ogbeche's attempt. But Cardiff were only able to hold off their guests until the hour mark.
Full-back Justin Hoyte busted a gut to create the overlap down the right and found McDonald in space.
The in-form Australian striker had timed his run to the near post and pushed the ball under Marshall as the keeper came out.
With 14 minutes remaining, Haroun broke Cardiff hearts as Julio Arca played a ball into box for the midfielder as he ran between two defenders.
The Belgian expertly chested down the spinning ball before smashing in the winner from close range.
Whittingham did go close with a 25-yard free-kick as Cardiff searched desperately for a leveller, but despite a late goalmouth scramble the hosts could not find a way through.