THE Camp Nou erupted. A late goal that turns the game around is enough to send any football crowd into raptures. But three? That was how many Barcelona required as the 90th minute approached on March 8th, in the second leg of a Champions League knockout tie against Paris Saint-Germain.

The Catalan club had already been routed in the first leg, losing 4-0 in a woeful performance away at the Parc des Princes on February 14th. Barça’s faint hopes of qualifying for the quarter-final were dampened further still by the away-goals rule: if the aggregate scores across the two legs are level at the end of the tie, the side which has bagged more goals away from home progresses. And sure enough, after the home side raced out to a 3-0 lead, Edinson Cavani, Paris Saint-Germain’s centre-forward, drove a volley into the roof of their net in the 62nd minute. That meant that Barcelona would have to beat them by five, leaving them three goals short with about half an hour to go. They failed to score any for the next 26 minutes.

Only when the 88th minute arrived did the floodgates open. Neymar won a free-kick 30 yards from goal, and arrowed it into the top corner. Two minutes later Luis Suárez, who had already been booked for diving, went down in the box at the slightest of touches and won a penalty, which Neymar scored. Five minutes of injury time were added on. In the fifth Barcelona earned another free kick, won by their own goalkeeper in the opposition half, since everyone had piled forward in search of a winner. The ball was lobbed into the box, cleared, chipped in again by Neymar—and poked home by Sergi Roberto. The clock showed 94:40. Pandemonium ensued. The celebrations were quite literally recorded on local seismographs.

Was this 6-1 victory the greatest escape in the history of the Champions League, the most prestigious tournament for European clubs—including the 38 years it was known as the European Cup? The answer depends on how one defines “greatest”. The simplest measure would be the size of a team′s lead after the first leg. By this figure, Barcelona′s accomplishment does indeed rank first: although eight clubs had previously reversed a three-goal disadvantage, none had come back from four (see table).

However, one could argue that this straightforward ranking is either too charitable or too harsh to Barcelona. On one hand, if you were going to bet on any team to score three goals in six minutes, it would be the one featuring the deadly front-line trio of Lionel Messi, Neymar and Mr Suárez. Together, they have found the net 335 times during the past three seasons. Even though Paris Saint-Germain are a formidable side in their own right—ClubElo.com, a website which evaluates teams using the Elo formula, ranked them sixth in Europe ahead of the second leg—they were still rated as far weaker than this historically great Barcelona team. Before the first leg began, ClubElo calculated Barça′s odds of progressing at 75%, making them a heavier pre-tie favourite than all but one of the eight teams that came back from three goals down. And even after their spanking in Paris, betting markets were so bullish on Barcelona’s forwards that they gave the team an impressively high 1-in-14 chance of reversing their deficit.

But if Barcelona′s advantage in talent makes their achievement look less impressive, the fact that they pulled it off in 2017 makes it especially remarkable. It is no coincidence that seven of the eight ties in the table are from the European Cup era, before 1992, when goals were far more plentiful. In the 1970 edition, in which Panathinaikos shocked Red Star Belgrade in the semi-finals, about 3.4 goals were scored per knockout match—a rate nearly 50% higher than the 2.3 in last season’s Champions League knockouts. In all competitions, defences have become more frugal and tactics more conservative, making goal-fests like the one Barcelona needed much rarer than they were in the past.

A further argument is that, in effect, it contained two resurrections in a single contest. Some of the competition’s most famous downfalls and recoveries have come within the space of one 90-minute game, rather than across two legs. Indeed, a home-and-away rollercoaster isn’t possible in the final of the Champions League, since it is a single match played in a neutral stadium. How then could we compare the earthquake at the Camp Nou to the Miracle of Istanbul—the 2005 final, in which an unfancied Liverpool side rallied from 3-0 down at halftime to beat the vaunted AC Milan?

To do justice to Barça′s twin comebacks, I built a statistical model that estimates two probabilities for Champions League ties: first, how often a team might win a tie given the score in the first leg; and second, their odds given the current score and time in the second leg (or a final). It was trained on every match played in the competition’s history, and accounts for the relative strength of the teams (where data were available) and the frequency of goal-scoring at any point in time.

The results confirm the popular notion that the recoveries by Liverpool and Barcelona belong in a league of their own (see chart below). Only three times in the dusty Champions League recordbooks has a club with less than a one-in-200 shot to win pulled it off. In 2013 Borussia Dortmund needed two goals in injury time to get past Málaga. The model calculated the chances of this outcome at 0.5%. Its scepticism may well have been justified, since Málaga partisans would insist that their side only lost because a linesman looked the other way when a Dortmund player ventured offside. The result of the Istanbul match was slightly less probable, requiring a humble Liverpool squad to notch three goals in 37 minutes against the might of AC Milan. The odds of that were just 0.4%. But even that astonishing revival was fully four times more likely than the Catalan comeback. After 87 minutes, the probability of Barça outscoring the Parisians by three was on the order of one in 1,000.

Choosing between these two correctly canonised comebacks is a matter of taste. Barcelona fans can note that their club deserves credit for both overturning a first-leg thrashing and for conquering the away-goals rule in the dying minutes of the tie. Liverpudlians would counter that their achievement occurred in a final and actually crowned a champion, rather than merely taking place in the round of 16. In an attempt to weight these arguments, I combined the twin improbabilities of each outcome into a single score, by adding the logarithm of the inverse of each team’s chance of winning before the second leg and at its lowest point during the game. I also awarded bonus points for victories that came later in the tournament, and doubled points for finals because they consist of a single leg rather than two. When all the sums were complete, Liverpool just nudged ahead of Barcelona.

This final ranking is of course highly sensitive to one′s choice of weighting. By limiting the analysis to individual ties, I treated each match as an independent achievement, giving no credit to clubs who pulled off multiple unlikely comebacks in the same tournament. Expanding the scope beyond a single tie might have elevated the triumph of Manchester United in 1999 to the top spot. The club′s victory over Bayern Munich in the final is justly famous, coming as it did via two injury-time goals. However, United also faced an equally difficult task in the semi-final. Having conceded two early goals away to Juventus, they needed to score twice on the road against one of Europe’s best defences. In each match, Manchester United’s win probability dropped to about 4%. Individually, those odds were far higher than those at Camp Nou and Istanbul at the maximum depths of despair for Barcelona and Liverpool. But in tandem, these comebacks in consecutive matches to win the Champions League are arguably as impressive.

Given the number of seemingly improbable comebacks during the past year, fans could be forgiven for a mild case of upset fatigue. Baseball’s Cleveland Indians surrendered an 85% shot of triumphing in the 2016 World Series after four games; basketball’s Golden State Warriors squandered a 95% chance of winning the 2016 NBA Finals coming into Game Five; and the Atlanta Falcons somehow ended up on the wrong side of a 99.6% probability of victory in the 2017 Super Bowl. But even against such formidable competition, Barça stands out. None of those events were as unlikely as their hopes of redemption when Neymar lined up his free kick with two minutes of normal time remaining.