Liverpool needed to do it all against Barcelona in the second leg of the Champions League semifinal on Tuesday. Despite creating chances, the Reds had failed to score in the first leg at Camp Nou last week, which meant they faced a 3-0 deficit going into Tuesday’s second leg at home against Lionel Messi’s squad. To advance to the final, Liverpool needed to score four times and prevent Barcelona — a team that possesses the best player in the world and one of the most potent attacks in Europe — from scoring what would likely be a decisive away goal.

The Reds managed to do both — and now they can sit back and wait for their opponent in the final on June 1 in Madrid.

To be clear, beating Messi and Barcelona by any margin in any game is a difficult task — ask any player in La Liga how it usually goes — but doing so in a Champions League semifinal, and without the help of injured forwards Mohamed Salah and Roberto Firmino, seemed damn near impossible.

Before the game began, the FiveThirtyEight Soccer Power Index agreed, giving Liverpool just a 7 percent chance to advance to the final. The model gave Barcelona a 93 percent chance to advance and a 61 percent chance to grab Europe’s top silverware. The odds to win the final have now swung precipitously in Liverpool’s favor: It has a 72 percent chance to take home the trophy if it plays Tottenham Hotspur and a 68 percent chance if it plays the Dutch club Ajax. The Reds’ only complaint now is that they can’t play the final at Anfield.

Despite the lopsided scoreline during the first leg between Liverpool and Barcelona, there was evidence that there wasn’t a significant gulf in class between them. The Reds took more total shots, made more passes inside the attacking third, made more passes inside their opponent’s penalty area, completed more total passes, whipped more crosses into the box and completed more tackles than Messi’s men. While a historic comeback was unlikely, Liverpool had certainly shown it was capable of hanging with Barca.

If the soccer gods were against Liverpool in the first leg — that Salah strike that rattled off the post late into the match suggested they might be — they were very much chugging pints on Merseyside on Tuesday. Liverpool got off to a quick start as Divock Origi scored off a rebound in the seventh minute. The early goal was crucial: Instead of marauding in search of an away goal that would have essentially ended the semifinal dead in its tracks, Barcelona looked shaken. They managed to get to halftime without conceding a second — and indeed almost got a much-coveted away goal deep into stoppage time — but it was clear the occasion was getting to them. Barcelona’s impotence allowed Liverpool to do the very, very unlikely and get three goals in the second half — two from substitute Georginio Wijnaldum and another from Origi.

Barcelona had more of the ball in the second leg, but the Blaugrana weren’t able to cash in when they got into dangerous spaces. They created just two big chances to Liverpool’s five, and aside from a couple of half-chances, Messi was uncharacteristically quiet. He took five shots, with just two of them on target, while never really troubling Liverpool keeper Alisson Becker. While an act of Messi magic changed the equation at the Camp Nou last week, the only magic on display by Barcelona at Anfield was a disappearing act.

Messi, soccer’s GOAT, has to endure yet another setback in a career that’s been defined as much by heartbreak as it has been by brilliance. And Liverpool will move on — no matter how miraculously — to play in a second-consecutive Champions League final.

Check out our latest soccer predictions.