Atalanta made history as they qualified for the Champions League knockout phase despite failing to win any of their first four matches, following a 3-0 win away at Shakhtar Donetsk on Wednesday.
Gian Piero Gasperini's men lost each of their first three matches and drew the other, but dragged themselves back to qualify.
They kicked off their debut campaign in Europe's premier club competition with a 4-0 defeat at Dinamo Zagreb before they suffered a 2-1 defeat at home to Shakhtar and a 5-1 defeat at Manchester City. In their home match against Pep Guardiola's side, they were 1-0 down before Gabriel Jesus missed a penalty. They eventually drew 1-1.
A 2-0 win over Zagreb at home meant victory away to Champions League regulars Shakhtar, coupled with a City win in Croatia, would have seen them progress. City did their job, winning 4-1.
Atalanta approached their decisive game with confidence, squandering plenty of chances, while also relying on goalkeeper Pierluigi Gollini to make several good saves.
They were lucky not to be reduced to 10 men when Luis Muriel, already on a booking, fouled Dodo, but referee Felix Zwayer awarded a free kick and no further punishment.
The Serie A side profited from their bout of good fortune and opened the scoring on 66 minutes through Timothy Castagne. The odds moved even further in Atalanta's favour as Dodo saw red for Shakhtar 11 minutes later following a clash off the ball.
On 80 minutes, Mario Pasalic made the result secure when he nudged home Ruslan Malinovskyi's free kick. Robin Gosens added a third in stoppage time, capitalising on a dreadful defensive error to seal a remarkable turnaround in fortunes and qualification for the knockout stage.