High-flying Sky Bet Championship side Cardiff avoided an FA Cup banana skin as Junior Hoilett's brace helped them win 4-1 at Mansfield to set up a fourth-round clash with Manchester City.
In front of the watching City boss Pep Guardiola, Bruno Ecuele Manga's 34th-minute opener put Cardiff in the driving seat, only for Danny Rose to level a minute for their League Two opponents later.
But the Bluebirds' class showed after the break, with Hoilett's strike putting them back in front and Anthony Pilkington making it 3-1 five minutes later, before Hoilett added his second at the death to crush the Stags' dream of a money-spinning tie against the Premier League leaders.
Cardiff took the lead when Joe Ralls' corner was headed goalwards by Sean Morrison, but his effort was cleared only as far as Manga, who slammed the ball into the net from two yards out.
The lead lasted just over 60 seconds, though, as the Bluebirds failed to clear a corner and Rose was on hand to ram home a shot and draw Mansfield level.
The visitors regained the lead after 65 minutes when Callum Paterson's cross was met at the back post by Hoilett, who made no mistake inside the six-yard box.
Five minutes later, Cardiff added a third when Pilkington converted Loic Damour's driven cross from close range, before Hoilett fired low past Conrad Logan two minutes from time to book their first fourth-round berth for 10 years.