Facing a three-goal deficit at halftime in their Champions League semifinal, Tottenham's players only had to think back 24 hours or so to find a source of inspiration.

"We saw Liverpool last night — it goes to show it's not over until it is over," Tottenham fullback Danny Rose said.

In this year's Champions League, that certainly seems to be the case. Just a day after Liverpool's stunning win over Barcelona, Tottenham pulled off another epic comeback on Wednesday.

Lucas Moura completed a hat trick in the sixth minute of injury time as Tottenham rallied to beat Ajax 3-2 and reach its first Champions League final, ending a remarkable run by the young Dutch team that had knocked off some of Europe's biggest clubs along the way.

It was a rally that was eerily similar to the one the previous night at Anfield, where Liverpool erased a 3-0 deficit from the first leg by beating Barcelona 4-0 at home.

In Amsterdam, Moura nearly single-handedly helped Tottenham pull off a similar feat.

Ajax seemed to have the two-legged semifinal wrapped up by halftime after teenage captain Matthijs de Ligt and Hakim Ziyech netted to put it 2-0 up at the break — and 3-0 on aggregate.

But Moura scored twice in a four-minute span to put the visitors one goal from going through 3-3 on aggregate thanks to the away goals rule.

After Jan Vertonghen's header hit the crossbar in the 87th minute, that goal finally arrived when Moura struck again deep into injury time. Dele Alli laid the ball off for the Brazilian as he streaked into the area and his low shot crept inside the right post to complete another improbable victory.

"It's impossible to explain what I'm feeling in this moment," Moura said. "We always believed it was possible, and we gave everything on the pitch. I think we deserved this moment."

Moura's winner led to a pile-up of Spurs players near the corner flag celebrating one of the biggest wins in club history, as the disbelieving Ajax players lay on the ground.

It means Tottenham will face Liverpool in Madrid on June 1 in the first all-English final since Manchester United beat Chelsea in 2008. That's a scenario few had imagined last week when Barcelona and Ajax both won the first legs.

For Ajax, it ended a run that saw a team built around young homegrown talents knock out Real Madrid and Juventus before putting themselves on the brink of the club's first Champions League final since 1996.

The hosts dominated the first half and De Ligt, the 19-year-old captain, headed home a corner in the fifth minute after goalkeeper Hugo Lloris had been forced into making a good one-handed save from Dusan Tadic.

Son Heung-Min countered by hitting the post at the other end minutes later but Ziyech doubled the lead in the 35th. Donny van de Beek streaked forward and laid the ball off to Tadic, who cut the ball back to Ziyech for a one-time finish beyond the reach of Lloris.

That should have been it, especially given the fact that Ajax had never lost a Champions League game after scoring the first goal.

But even without injured star striker Harry Kane, Tottenham found a way back.

In a second half filled with chances at both ends, Moura started the comeback after a quick counterattack as Alli again laid the ball off for the streaking Brazilian to slot a low shot past goalkeeper Andre Onana.

The second came after Onana made a stunning close-range save to deny Fernando Llorente but couldn't control the ball, and it fell to Moura in the following scramble. With his back to goal, the Brazilian swiveled and fired into the left corner of the net.

Suddenly the semifinal was hanging in the balance again, and both teams missed chances to score a third. Ziyech had the best opportunities for Ajax but he shot just wide when he was picked out by Tadic in the middle of the box in the 63rd and then hit the post with a similar effort in the 79th.

That proved costly as Spurs launched one desperate counter just as the five minutes of added time were nearly up. A long ball up the pitch fell to Alli, who created a chance for Moura to complete another dramatic semifinal comeback.

"We were so close, we had so deserved it, but that last second," Ajax coach Erik ten Hag lamented. "When that ball hits the post from Hakim Ziyech, it's over and out for Spurs. But I can't blame anyone. We have had an incredible Champions League season and have grown a lot as a team. It is difficult to process."

Tottenham manager Mauricio Pochettino, who is still aiming for his first title with the club, was in tears as he celebrated on the field and broke down again in a TV interview.

"It's still difficult to talk. Thank you football, thank you these guys, my players. This type of emotion, without football I think is impossible to," experience, Pochettino said. "They are all heroes but (Moura) is a superhero."