Marvin Emnes struck with 15 minutes remaining to inflict Cardiff's first home defeat of the season as Swansea enhanced their Championship promotion credentials with a deserved victory.
Swansea largely dominated the second half of this hotly-contested Welsh derby and on-loan Middlesbrough winger Emnes lashed home a low shot from 20 yards to settle the south Wales derby clash and haul them to within three points of second-placed Cardiff.
It was the Dutch player's second goal in four games and left Cardiff, who sorely missed suspended striker Jay Bothroyd alongside Craig Bellamy, licking their wounds.
Swansea manager Brendan Rodgers said: "It was a fantastic result and a wonderful team performance because to come to Cardiff and win such an emotional derby game is superb, both for the players and our fans. Cardiff gave us massive respect by changing their style to 4-3-3, so it took us time to settle down."
Cardiff manager David Jones said: "We were punished for a mistake. We will be hung, drawn and quartered now for a week but it's only one game and there is still a long way to go.