Middlesbrough ended Wigan's Carling Cup dream at the JJB Stadium, but not before Steve McClaren's side were given the fright of their lives.
A goal in each half from Massimo Maccarone and Gaizka Mendieta was enough for the Premiership outfit to squeeze into the next round, but they were rattled by a tremendous Wigan display that deserved more than a disappointing defeat.
And when midfielder Jimmy Bullard thundered home a free-kick with 15 minutes to play the home fans were preparing for a grandstand finish from the first division high-flyers.
Wigan can look back on a number of missed chances, especially in the first half, as they let their opponents off the hook. Both Lee McCulloch and Neil Roberts squandered before the interval, with McCulloch bringing a tremendous save from Boro keeper Mark Schwarzer.
But the visitors led at the break after Danny Mills beat three men and hit a shot that appeared bound for the arms of home keeper Gary Walsh, only for Maccarone to deflect it in.
The home pressure continued after the break and Jason Jarrett amazingly fired wide after Peter Kennedy's perfect cross caused havoc in the visiting defence.
But against the run of play, Boro extended their lead when a charged down clearance fell to Juninho and the Brazilian sprinted 40 yards before squaring the ball to Mendieta to blast home.
Far from knocking the stuffing out of the home side, they came back with a vengeance and Bullard's free kick set up a tense finish, but the Premiership outfit held on.