Red card for Cardiff midfielder Stephen McPhail.
Cardiff manager Dave Jones was disappointed after a goal in the 57th minute by Jordi Gomez settled the first South Wales derby in nine years.
Gomez struck a free-kick through the wall and into the corner of the net to give the Swans a deserved victory in tonight's Carling Cup third round match at the Liberty Stadium.
Cardiff midfield general Stephen McPhail was sent off in the 74th minute following a series of rash challenges, and the Bluebirds had four other players yellow-carded as the game threatened to boil over.
Both sides put out strong teams, but the Bluebirds' experiment of playing USA international Eddie Johnson up front proved to be a failure, and he was replaced by leaving scorer Ross McCormack at the interval.
"It was very disappointing, as we let ourselves and our fans down," said Cardiff manager Dave Jones.
"It was our worst performance of the season, and I have no complaints about losing.
"We didn't deserve to win the game, and players shouldn't be jumping into the tackle, but that is another set-piece which has let us down.
"We lost our discipline, and I have no complaints about the other bookings, but I think Stephen McPhail actually won the ball when he received his second yellow card.
"Fair play to Swansea, but now we look back to the league this Saturday, and this defeat may make us more determined. Both sides tried to play, but Swansea were a little better than us."
The order was set for the game as early as the sixth minute when Cardiff's Joe Ledley received the first of the yellow cards, but in the opening quarter-hour Cardiff pushed the ball about and were on top without troubling the home defence.
Jones made a change at the interval, bringing on McCormack, but still the Bluebirds were unable to trouble the home defence.
In the 56th minute Mark Gower was fouled by McPhail on the edge of the area, and Gomez sent the free-kick through the wall and into the corner of the net.
The Swans turned up the tempo, and the Bluebirds were back-pedalling, even more so after they were reduced to 10 men for the final 15 minutes.
"I thought it was a deserved victory, and the atmosphere has made it a very special day," said Swansea boss Roberto Martinez.
"The first 20 minutes, Cardiff made it difficult for us, but then we kept hold of the ball, and it was a good level of performance from all my players.
"We knew how important it was to our fans to get this victory, and they certainly helped us with their massive support.
"This night will be remembered for a long time, as the game fulfilled all expectations. It was a magnificent derby and a good advertisement for Welsh football."
::Despite South Wales Police assistant chief constable Robert Evans' appeals for supporters to be on their best behaviour, there was trouble at the end of the game as fans clashed with police prior to leaving the ground.