Beware the Atlético Madrid sucker punch. Liverpool knew it was a possibility, however much they controlled this Champions League tie, however much they dominated in terms of possession and chances. While the margins remained slim, it could happen.

It almost came at the end of normal time when Trent Alexander-Arnold conceded a needless free-kick and the unmarked Saúl Ñíguez headed Renan Lodi’s delivery past Adrián. The Atlético celebrations ignited like a firecracker only to fade upon the sight of an offside flag against Saúl.

Liverpool ought to have won this game several times over. They attacked in waves, battering Atlético, testing their resilience to the limit. The most influential player on the pitch was the visiting goalkeeper, Jan Oblak, who made a string of excellent saves. Diego Simeone, the Atlético manager, said afterwards that “Barcelona have Messi but we have Oblak”. Liverpool also blew fistfuls of chances, none more gilt-edged than the 67th-minute header that Andy Robertson crashed against the crossbar when gloriously placed.

Klopp’s team had led on the night through Gini Wijnaldum’s header on 43 minutes and, early in the extra period, they finally got the goal that put them in front on aggregate. Wijnaldum was the creator, powering up the right flank to cross for Roberto Firmino, whose header hit the inside of the post. When the ball rebounded to him, he steered it into the other corner.

Job done? Not at all. The sucker punch came when Adrián accepted a back-pass from Alexander-Arnold and shanked his clearance low and straight to João Felix, who moved it to the substitute Marcos Llorente. The midfielder, who joined last summer from Real Madrid, is not noted for his goalscoring prowess but nobody would have known it. He took one touch to set himself before banging low into the bottom corner. Adrián was extremely slow to get down and across.

Marcos Llorente compounds Adrián’s mistake by firing Atlético’s first goal past the Liverpool keeper’s feeble dive. Photograph: Peter Powell/EPA

Llorente was not finished. At the end of the first period of extra time, he took a pass from another substitute, Álvaro Morata, as Atlético broke and, with Liverpool players backing off, he repeated the trick. Touch, shot, goal. Again, Adrián was nowhere near to the shot and it was easy to imagine that Oblak or, more pertinently, Alisson – Liverpool’s injured No 1 – would have done better.

Liverpool were broken and Morata rubbed salt into their wounds by running through at the very end to score again. Simeone’s joy knew no bounds. It has been a difficult season for him and his team on the domestic front, with them currently lagging in sixth in La Liga, 13 points behind the leaders, Barcelona. But here, they dug in for a famous win. They found a way.

For Liverpool, it added up to a first home defeat in 18 months and a first ever European knockout reverse under Klopp. Most gallingly, they felt their grip loosen on the trophy that they had won last May, when they beat Tottenham at Atlético’s stadium to enable them to add a sixth star to their shirts. They are set to secure a first Premier League trophy since 1990 in the coming days or weeks and, in time, that will feel like the most important detail of a phenomenal season. Here, there was only frustration.

In the end, it was comfortable for Atlético but for the overwhelming majority of normal time, this was a siege, with Liverpool working the ball expertly and finding the spaces for first-time crosses. In total they racked up 34 attempts on goal and won 16 corners.

Diego Simeone is elated on the touchline as his side came back from 2-0 down in extra time to win 3-2 on the night and 4-2 on aggregate. Photograph: Julian Finney/Getty Images

Wijnaldum had an early headed sighter and Oblak was extended more and more as the first half wore on. He saved smartly from Alex Oxlade-Chamberlain and Sadio Mané while he showed good reactions to beat away an Alexander-Arnold cross that came through a crowd. In between times, Mané saw a header blocked by Lodi. Wijnaldum’s goal came when he held his run by the penalty spot and summoned power and accuracy in his header from Oxlade-Chamberlain’s cross. The ball bounced down and seemed to pick up speed off the turf on its way in.

Atlético were overrun in the second half and they had Oblak to thank for keeping them alive. His save to tip away a low Oxlade-Chamberlain effort from distance on 54 minutes, having snaked out a long arm, was of the highest order while his presence seemed to spook Firmino at the far post following a whipped Alexander-Arnold delivery.

Felipe had glanced wide at the near post following a Koke corner on 18 minutes and Felix worked Adrián on the break during the second half, the Liverpool goalkeeper rather fumbling the save and then diving to reach the loose ball ahead of Ángel Correa. But that was it from Atlético until Llorente drove the stunning turnaround and Klopp would not hide his anger at their defensive approach.

Liverpool pressed on, with Robertson blowing his header and also shooting wastefully while Oblak denied Alexander-Arnold, Mané was high with an overhead kick and Salah shot off-target. The script for Liverpool had called for another European comeback, with Klopp having presided over a few of those at this stadium. Atlético had not read it.