Everton and Tottenham Hotspur both missed the chance to move up to second place in the Premier League after they shared a battling 0-0 draw at Goodison Park on Sunday.
Spurs, who dominated the first half, climbed to fourth, level on 20 points with second-placed Chelsea and Liverpool who are third. Everton stayed seventh on 19 points, level with Manchester City and Southampton.
The winning goal was headed home after 62 minutes by England defender Steven Caulker who spent the 2011-12 season on loan at Swansea from his previous club Spurs.
Swansea's miserable trip to Cardiff was completed early in stoppage time when goalkeeper Michael Vorm was sent off for clattering Fraizer Campbell when he was through on goal. As Swansea had used all their substitutes midfielder Angel Rangel played out time in goal.
Earlier, Spurs played some excellent approach football at Goodison, although, as so often this season, they failed to make their chances count and had to settle for a point.
"It was very tight, a good game. We had good moments and a great first half and we should have gone ahead," Spurs manager Andre Villas-Boas told the BBC.
"The second half evened itself out and in the last 30 minutes they had a go at us. We could have gone second but, considering Everton's aspirations, it was important to get a point."
Everton manager Roberto Martinez told Sky Sports: "Spurs are a very good side and work very hard when they lose the ball and that upset our rhythm.
"But we found that rhythm in the second half and it became an open game with two teams who wanted to win and not settle for a point."
Although Everton rallied after halftime, apart from a cross shot from former Spurs midfielder Steven Pienaar that went narrowly wide of the far post they rarely threatened Hugo Lloris's goal.
The France goalkeeper stayed on the pitch until the end despite taking an accidental knee in the head from Everton striker Romelu Lukaku in the latter stages.
At one point it looked as though Lloris was going to be carried off on a stretcher, but with substitute goalie Brad Friedel ready to come on, Lloris decided to continue.
His injury prompted a lengthy delay and the addition of nine minutes of stoppage time.
"Hugo still doesn't remember the incident with Lukaku," Villas-Boas said.
"He lost consciousness there but he seemed assertive and determined to continue and showed great character and personality. We decided to keep him on based on that."
The Welsh derby swung Cardiff's way after an evenly fought opening hour between the two fierce rivals who used to play each other in the fourth tier of English football in the late 1980s.
Caulker swung it Cardiff's way, though, when he rose above Chico Flores to head home a corner.
Caulker did not celebrate the goal and told Sky Sports: "It was a different experience playing against Swansea. I enjoyed my time there but I am a Bluebird and I was focused on getting the win for us.
"I didn't celebrate because I have always respected the teams I have played for, but it was good to get the goal."
Swansea manager Michael Laudrup said: "It hurts to lose a derby. They didn't do much apart from score from a set piece, but that's it, they scored and we didn't.
"I've no complaints about the sending off. He was the last man and that's what happens."
Swansea failed to impose themselves on the game and the victory lifted Cardiff up to 12th in the standings, one place and one point above their beaten opponents.
Image: Despair for Swansea City as Steven Caulker of Cardiff City (2R) celebrates scoring
Photograph: Laurence Griffiths/Getty Images