A stunning double strike from Cardiff's Robert Earnshaw got their promotion bandwagon back on track at Layer Road.
He opened the scoring with a left-foot shot just before half-time, only to see Colchester's Micky Stockwell equalise at the beginning of the second period after a slip from Spencer Prior.
The Bluebirds' Fan Zhiyi and Kevin Rapley of Colchester were then sent off after a clash near the byline.
But the abiding memory of the night was provided by a sublime 'Earnie' goal 13 minutes from the end.
There was nothing on as he held the ball with his back to goal inside the Colchester box.
But he was able to turn, swivel and loft it with his left over defender and keeper into the far corner.
The score leaves Earnshaw as the leading scorer in division two with 21 goals.
Colchester: Brown, Stockley, Warren, Fitzgerald, White, Duguid, Stockwell, Bowry, Izzet, Rapley, Morgan. Subs: Pinault, Coote, Atangana, Baldwin, McKinney.
Cardiff: Alexander, Weston, Prior, Zhiyi, Barker, Kavanagh, Boland, Legg, Earnshaw, Campbell, Thorne. Subs: Bowen, Fortune-West, Croft, Maxwell, Margetson.
Referee: U Rennie (S Yorkshire)
Att: 4,516