Cardiff claimed their first away win of the season as they repelled Middlesbrough's second-half comeback to claim a 3-2 victory at the Riverside.
The Bluebirds looked to be strolling to all three points as they claimed a three-goal lead at the interval thanks to strikes from Callum O'Dowda, Mark Harris and Perry Ng.
Middlesbrough rallied after the break, scoring two goals in a minute through Duncan Watmore and Rodrigo Muniz, but despite some late pressure from the Teessiders Cardiff held on to claim a deserved success.
Middlesbrough's previous home outing had seen them beat North-East rivals Sunderland, but any hopes of maintaining the feelgood factor generated by the derby win disappeared when Cardiff opened the scoring in just the fourth minute.
Joe Ralls dispossessed Matt Crooks close to the halfway line, Callum Robinson sent O'Dowda racing clear of Paddy McNair down the left-hand side and, after advancing into the area, the Bluebirds winger slotted a slick low finish through the legs of Middlesbrough goalkeeper Liam Roberts.
Cardiff came into the game having failed to win any of their previous five matches but the visitors were the dominant force throughout the opening half-hour.
Harris' back-post header was saved by Roberts in the 13th minute but when the striker was presented with another opportunity seven minutes later he was not found wanting.
Jonny Howson paid the penalty for dawdling on the ball deep in his own half, with Andy Rinomhota seizing possession. Robinson rolled the ball into Harris' path 20 yards out and the 23-year-old rifled a superb finish into the top right-hand corner.
Middlesbrough's first-half attacking was extremely underwhelming, although the hosts should have done better shortly before the half-hour mark when Muniz rose to meet Ryan Giles' corner on the edge of the six-yard box. Muniz got his attempted header all wrong and the ball flew wide off his shoulder.
It proved a rare foray forward for the hosts, who fell three goals behind on the stroke of the break. Ng played a one-two with Rinomhota and, after strolling past Matt Clarke and Dael Fry, the defender stroked a composed finish into the far corner.
Crooks headed wide from a corner as Boro tried to stage a revival at the start of the second half and, after Chris Wilder made three changes in an attempt to change things, the Teessiders gave themselves a chance with two goals in the space of a minute.
Watmore scored the first in the 76th minute, with the substitute slotting home an angled finish after a pass from Isaiah Jones.
Less than 60 seconds later Muniz set up a grandstand finish as he leapt between two Cardiff defenders to head home Anfernee Dijksteel's cross, but it proved to be in vain for struggling Boro.
Cardiff City: Allsop, Romeo, Ng (Nelson 79'), Kipré, Simpson, O'Dowda (Nkounkou 67'), Wintle, Rinomhota, Ralls (Sawyers 37'), Robinson (Ojo 67'), Harris (Colwill 79').
Subs not used: Alnwick, Philogene.
Middlesbrough: Roberts, McNair (Dijksteel 46'), Fry (Forss 89'), Clarke (Bola 64'), Jones, Crooks, Howson, Mowatt (Watmore 46'), Giles, McGree, Muniz.
Subs not used: Daniels, Smith, Luongo.