Jose Mourinho survived a huge scare on his home debut as Tottenham Hotspur manager as his side came from 2-0 down to beat Olympiakos 4-2 and reach the last 16 of the Champions League.
The Greek champions blew a huge chance to give themselves a shot at reaching the knockout stages after scoring twice in the first 20 minutes through Youssef El Arabi and Ruben Semedo.
Dele Alli pounced on a horrible defensive mistake to breathe new life into Spurs before the break and a second half double from Harry Kane either side of Serge Aurier's fine strike completed the comeback.
Last season's Champions League finalists can now look forward to the knockout stages for a third straight season, but will go through in second behind Bayern Munich in Group B after the German giants secured top spot with a 6-0 thrashing of Red Star Belgrade.
Spurs have now scored seven goals in winning Mourinho's first two games in charge to make a good first impression on many supporters unconvinced by the appointment of a former Chelsea manager renowned for a more conservative style of football.
However, the first 20 minutes showed the work Mourinho has ahead to make Tottenham as tight at the back as his most successful sides over the past two decades.
The warning signs were there for the hosts as early as six minutes in when El Arabi was afforded room on the edge of the box to line up his shot and found the bottom corner despite Paulo Gazzaniga getting a hand to it.
Only a brilliant recovery challenge from Davinson Sanchez denied Daniel Podence from doubling the away side's lead as Spurs were then opened up by one simple pass through midfield.
Moments later it was 2-0 as more sloppy Spurs defending from a corner left Semedo in space to prod home Guilherme's near-post flick on.
Mourinho had seen enough inside the first half hour to make a change as Eric Dier was sacrificed to make way for Christian Eriksen.
However, it was a huge error from Olympiakos rather than a moment of inspiration that gifted the hosts a route back into the game.
Aurier's low cross from the right should have been easily cleared by Yassine Meriah, but he let the ball slip under his foot and Alli was on hand to tap in at the back post in first half stoppage time.
That goal made Mourinho's half-time team talk a far easier one and Spurs built on their momentum by equalising five minutes after the restart.
Quick thinking from a Spurs ball boy and Aurier caught Olympiakos napping as the Ivorian's throw-in freed Lucas Moura down the right and his cross was swept home by Kane.
Aurier was the unlikely hero once more 17 minutes from time as he sweetly connected with Alli's cross at the back post to put Spurs in front.
Uncertainty over Eriksen's future has been one of the scourges of Spurs' season.
Such a key figure for much of Mauricio Pochettino's five-and-a-half years in charge, the Dane has more often than not been left on the bench both by the Argentine prior to his dismissal last week and in Mourinho's first two games in charge.
But he offered a glimpse of the quality he can offer with a wicked dipping free-kick from which Kane stooped to head home his 23rd goal of the season in as many games for club and country.
(For more sports news and updates, follow Ahram Online Sports on Twitter at @AO_Sports and on Facebook at AhramOnlineSports.)