A thunderous shot from Peter Thorne in the 74th minute was enough to give Cardiff a deserved victory over Port Vale.
A Neil Alexander pass was helped on by Andy Campbell and Thorne raced clear before smashing a shot past Mark Goodlad in the Vale goal.
There was a bizarre twist to the game when the referee's assistant was helped off after 35 minutes only for referee Phil Richards to suffer a shoulder injury and also go off just before City's winner.
That brought on home steward Tony Jones, a qualified referee who had last officiated in the League of Wales five years ago.
He saw out the last 15 minutes of the game as a referee's assistant.
In a poor first-half the Bluebirds almost went ahead in the sixth minute when a Scott Young header was brilliantly saved by Goodlad.
Vale could have stolen the lead in the 19th minute when an Ian Armstrong header was tipped away by Alexander.
Cardiff were the stronger side in the second-half and though they missed the injured Andy Legg, the return of Robert Earnshaw was a bonus.