Cardiff dropped out of the Sky Bet Championship automatic promotion places after Fulham inflicted a 4-2 defeat on Neil Warnock's side.
Floyd Ayite crossed for Tim Ream to put the visitors 1-0 ahead in the first half before he got on the scoresheet to double the lead in the second half.
A spectacular strike from returning Bluebirds striker Kenneth Zohore looked to have sparked a comeback. But Ryan Sessegnon made sure Fulham would be the first team to win at the Cardiff City Stadium this season.
There was still time for Callum Paterson to give Cardiff hope in stoppage time, before Stefan Johansen got Fulham's fourth with virtually the final kick of the game. The result means Warnock's men drop into third place behind Bristol City on goal difference.
Fulham felt they should have had a penalty in the fifth minute after Bruno Manga had looked to have brought down Johansen after the Norwegian burst into the box. But referee Simon Hooper waved away strong appeals from the Cottagers' players and staff and allowed play to go on.
The breakthrough came after 12 minutes when Fulham winger Ayite swung the ball back into the penalty area after it was cleared by the Cardiff defence. He found the head of Kevin McDonald, who flicked it on for Ream to nod in at the far post.
Joe Ralls had a low shot saved by Marcus Bettinelli, before the Fulham goalkeeper was called into action again to keep his side's 1-0 lead intact.
Tom Cairney almost made it 2-0 seven minutes into the second half when he ghosted past Loic Damour and curled a shot inches wide of the post.
Sheyi Ojo had an opportunity of his own, before Ayite looked to have wrapped up the three points in the 56th minute. The Togo international exchanged passes with Sessegnon down the left flank before bursting into the box and steering the ball past Neil Etheridge.
But the comeback looked to be on two minutes later when the ball sat up for Zohore to unleash a fierce left-footed volley to make it 2-1.
Cardiff pressed for the equaliser that would have kept them in the top two, but it was Fulham who struck to secure all three points. Substitute Rui Fonte broke downfield and spread the ball to the onrushing Sessegnon, who touched the ball past Sol Bamba and finished into the bottom corner.
There was still time for Lee Peltier to cross for Paterson to give Cardiff hope in stoppage time, before Johansen chipped in at the death to make it 4-2.
Cardiff: Etheridge; Peltier, Manga, Bamba(Capt), Bennett; Ralls, Bryson, Damour(Paterson 74); Mendez-Laing, Zohore, Hoilett(Healey 74).
Subs Not Used: Murphy(gk), Halford, Feeney, Pilkington, Tomlin.
Fulham: Bettinelli; Fredericks, Kalas, Ream, Odoi; McDonald, Johansen, Cairney(Capt), Ojo(Kebano 86); Sessegnon(Piazon 90), Ayite(Fonte 77).
Subs Not Used: Button(gk), Djalo, Norwood, de la Torre.
Cardiff: Zohore 58, Paterson 90+1
Fulham: Ream 12, Ayite 56, Sessegnon 78, Johansen 90+6
YELLOW CARDS -
Cardiff: Ralls 90
Fulham: Ayite 34, Fredericks 43, Odoi 82, Bettinelli 90+1
Referee: Simon Hooper (Wilts)