Match ends, Cardiff City 1, Wigan Athletic 2.
FA Cup holders Wigan kept up the defence of their crown by knocking Premier League Cardiff out to move into the last eight.
Chris McCann turned in a low cross to put the Championship side ahead before Fraizer Campbell lashed in a leveller.
Midfielder Ben Watson restored Wigan's lead before half-time with a 25-yard piledriver following a free-kick.
Cardiff's Juan Cala was denied by a post while Craig Noone had a late shot saved as the hosts bowed out.
The home side, who are second-from-bottom in the Premier League, pushed plenty of players forward to try to equalise only for a determined rearguard Latics action to keep them at arm's length for the most part.
Wigan were playing their 42nd match of a season which has included Europa League football on the back of beating Manchester City in last season's FA Cup final, but took another Premier League scalp having beaten Crystal Palace in the last round.
It was the first time the team had played each other in the FA Cup but there was plenty of history between the two managers.
Cardiff boss Ole Gunnar Solskjaer played at Manchester United, while his counterpart Uwe Rosler was at rivals Manchester City during their playing days.
Rosler was also caretaker manager at Molde before Solsjkaer became the Norwegian club's full-time manager, and the two friends also met for a chat at a hotel the night before the match.
However, any sentiment was put one side as the visitors began the stronger and were rewarded when they took the lead.
Midfielder Jordi Gomez fired in a low cross for McCann, who did well to deal with the pace of the ball and sidefoot in a left-foot finish.
Cardiff had struggled to impose themselves but were level when winger Wilfried Zaha slipped in the area and, after Wigan failed to clear, Campbell powered in a left-foot strike.
The pattern of the game had seen both teams score against the run of play and that continued when Watson, who scored the winner in last year's final against City, thundered a strike past keeper David Marshall after a free-kick had been rolled into his path.
The goals opened up the game into an absorbing spectacle and Cala looked set to level for Cardiff but his header from a yard hit the post.
McCann almost scooped in an effort for the visitors but that was a rare chance as the second half failed to match the entertainment of the first.
Cardiff rarely threatened to get back on level terms apart from in a frantic finish when Noone cut in from the right and had his shot palmed wide by Wigan keeper Ali Al Habsi.
Cardiff manager Ole Gunnar Solskjaer:
"We are disappointed. If you look at the game in terms of possession and chances we should have won but we didn't score the goals.
"It gives us a blow. You don't want to lose games as you suffer a little bit of a confidence dip but the way I was made was that when you want to lose a game you want to bounce back as a player.
"Knowing these lads, they are probably made from the same stuff I am.
"I wish Uwe all the best."
It took Wigan eight hours to get to Cardiff on Friday after their flight was cancelled and Wigan boss Uwe Rosler said:
"The longer the game went, we got a little bit tired.
"After the big disruption with the travel I have to give my players a massive compliment that they held out.
"I'm delighted with effort and performance. We showed our supporters, who came in big numbers, that we meant business and we really care to be the FA Cup holder and want to go as far as we can in the competition."
- 15Wolff EikremSubstituted forKimat 78'minutes
- 27Torres Ruiz
- 8MedelSubstituted forCowieat 45'minutes
- 34BergetSubstituted forNooneat 61'minutes
- 22BeausejourBooked at 65mins
- 7McCannBooked at 73mins
- 8WatsonSubstituted forMcEachranat 58'minutes
- 14Gómez García-PencheSubstituted forCraineyat 78'minutes
- 15McManamanSubstituted forMcCleanat 67'minutes
- Martin Atkinson
- Shots on Target
Second Half ends, Cardiff City 1, Wigan Athletic 2.
Attempt blocked. Steven Caulker (Cardiff City) right footed shot from outside the box is blocked. Assisted by Kim Bo-Kyung.
Offside, Cardiff City. Kim Bo-Kyung tries a through ball, but Cala is caught offside.
Offside, Wigan Athletic. Joshua McEachran tries a through ball, but Marc-Antoine Fortuné is caught offside.
Kévin Théophile-Catherine (Cardiff City) wins a free kick in the defensive half.
Foul by Marc-Antoine Fortuné (Wigan Athletic).
Foul by Craig Noone (Cardiff City).
Roger Espinoza (Wigan Athletic) wins a free kick in the attacking half.
Attempt saved. James McClean (Wigan Athletic) left footed shot from outside the box is saved in the centre of the goal. Assisted by Marc-Antoine Fortuné.
Attempt missed. Andrew Taylor (Cardiff City) right footed shot from outside the box misses to the right.
Attempt missed. Craig Noone (Cardiff City) left footed shot from the right side of the box is high and wide to the left. Assisted by Wilfried Zaha following a corner.
Corner, Cardiff City. Conceded by Ali Al-Habsi.
Attempt saved. Craig Noone (Cardiff City) left footed shot from outside the box is saved in the centre of the goal. Assisted by Fraizer Campbell.
Attempt blocked. Craig Noone (Cardiff City) left footed shot from outside the box is blocked. Assisted by Andrew Taylor.
Offside, Cardiff City. Wilfried Zaha tries a through ball, but Cala is caught offside.
Attempt saved. Wilfried Zaha (Cardiff City) right footed shot from the left side of the box is saved in the centre of the goal. Assisted by Kim Bo-Kyung.
Corner, Cardiff City. Conceded by Ali Al-Habsi.
Attempt saved. Mats Daehli (Cardiff City) right footed shot from the left side of the box is saved in the top centre of the goal. Assisted by Kim Bo-Kyung.
Fraizer Campbell (Cardiff City) wins a free kick in the attacking half.