At the stroke of 90 minutes, Málaga had this thing in the bag. But when the final whistle blew, the Borussia Dortmund players jumped into a celebratory dog pile instead.
In the 90th minute, Manuel Pellegrini was a genius, set to lead his second provincial club into the Champions League semifinals. (He took Villarreal there in 2006.) Málaga, banned from competing in Europe next year because of overwhelming debt, would finish among the top four teams in the continent.
The lowest-ranked seed during the group draw to qualify for the semis was AS Monaco, at 29th. Málaga was seeded 30th.
Pellegrini's lineup choices, including Julio Baptista up top and Isco on the left, strangled Dortmund's passing game. Without Mats Hummels, the lumbering BVB center backs knocked the ball around between them and then lumped it forward.
"It was hard for us to find our way into this match," Dortmund sporting director Michael Zorc told Sky at half time. "We were very nervous."
"For the first time this year we showed nerves," coach Jürgen Klopp said after the match. "We played uninspired and without movement. Málaga defended well but on the other hand we were easy to defend today."
Joaquin opened the scoring with a clever cutback at the top of the box after a neat interchange with Isco. Joaquin, who freely admits breastfeeding until age seven, had two more open chances from set pieces, which BVB defended haphazardly. Málaga was sucking at the teat of glory by the time Eliseu scored with 10 minutes remaining to make it 2-1, with the Spanish side ahead on away goals.
By then the match had turned into the Willy Show: Caballero made 12 saves over the course of the two ties.
No team since Manchester United in 1999 has scored twice in stoppage time needing two to win a Champions League game. No team since Ajax in 2005 had scored twice in stoppage time period. Well, now no team since Borussia Dortmund in 2013.
"We were two minutes short," Jérémy Toulalan told beIN Sport.
Marco Reus and Felipe Santana scored scrappy goals. "Everybody was close to a heart attack," Klopp said. Dortmund scored a historic victory of the highest drama.
"What can you say when something like this happens?" Robert Lewandowski asked. Jürgen Klopp didn't know. "I can't explain this," he said, "and I was a witness."
Not even the seemingly impenetrable Caballero could stop Dortmund. Not even Santana's offside position could keep BVB from progression.
"I've never experienced anything like it," CEO Hans-Joachim Watzke told Sky. "One moment you're dead and in the next moment you're in the semifinal. That is totally crazy."
Dortmund enters the semifinals on the back of the most insane finish a quarterfinal can offer, but also having topped a group that included Manchester City and fellow semifinalist Real Madrid. That's not bad for a club that faced liquidation a decade ago.
"When we fought for survival eight years ago, nobody would have dreamed of this," Watzke told Sky before the match.
Málaga now faces its own pressing financial concerns. The key components of the club will likely disband this summer, with Pellegrini admitting after the match that the club has gone as far as it can.
On Tuesday, the Málaga players wore black armbands for the death of Pellegrini's father. Now, ashen faced, they mourn the death of what so very nearly came to be.
The fairytale ending wavered for two minutes of stoppage time and eventually favored Dortmund.
"Up until now, our story was seriously like a Hollywood movie, so I hope it has a Hollywood ending," Neven Subotic told Sky Sports.
Follow ZAC LEE RIGG on Twitter or shoot him an email