Championship outfit Birmingham grabbed early second-half goals from Dan Burn, Matt Green and Tom Adeyemi to delight the home crowd at St Andrew's after their Premier League opponents had the better of the first period.
Wilfried Bony scored in injury time for Michael Laudrup's side, but it was a case of too little, too late for the visitors.
There were 10 changes from the Swansea side that beat Crystal Palace in the Premier League on Sunday, with Jonjo Shelvey the only man to keep his place as close-season recruits Alejandro Pozuelo and Bony started.
Birmingham manager Lee Clark, on the other hand, made just five alterations from the team that overcame Sheffield Wednesday 4-1 in the Championship last time out, with Jesse Lingard the most notable absentee.
The 20-year-old, who joined on a season-long loan from Manchester United last week, scored all four goals in their win at St Andrew’s on Saturday but cannot play in cup competitions due to a clause in his contract.
But despite the youngster’s absence, Birmingham created the first goalscoring opportunity of the game after 13 minutes when Chris Burke fired over the bar from the edge of the area.
However, Swansea almost took the lead just minutes later when Bony hit the bar before Pozuelo also clattered the woodwork with the follow-up.
The Premier League side then began to assert their authority on the game and the Ivory Coast international went close again shortly after, as his powerful shot was blocked in the 30th minute.
Roland Lamah was next to have an effort on goal for Laudrup’s men, but his shot was kept out by the feet of Birmingham keeper Colin Doyle as half-time drew in.
The home side came out the more energised team after the break though, and they soon created a chance as Matt Green forced Gerhard Tremmel into a great save with five minutes gone.
Their pressure soon paid off, and it was Burn who broke the deadlock as the defender netted an unmarked header in the 55th minute.
And things then went from bad to worse for Swansea just minutes later as Green met a cross from Mitch Hancox to leave Tremmel with no chance.
Laudrup then opted to make changes in an attempt to change the flow of the game, with Alvaro Vazquez and Jose Canas replacing Jonathan de Guzman and Shelvey.
But Birmingham were rampant by this point and increased their advantage when Adeyemi capitalised on a Canas error to claim the third with less than 10 minutes remaining.
Bony then headed home from a Wayne Routledge corner in the dying seconds, but this was no more than a consolation for Laudrup's side.
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.