Manchester City lost for the first time in 29 matches as Ukrainian side Shakhtar Donetsk won to join City in the last 16 of the Champions League.
A much-changed City, who had already secured top spot in Group F, fell behind when Brazilian Bernard curled a shot past Ederson from 15 yards.
Shakhtar doubled their lead as Ismaily capitalised on an Ederson error and tapped the ball into an empty net.
Sergio Aguero scored an injury-time penalty after Gabriel Jesus had been fouled by Bohdan Butko, but City could not extend their unbeaten record in 2017-18.
City had been hoping to become the first British club to win all six of their group matches in one Champions League season, but instead suffered their first defeat since Arsenal beat them 2-1 in the FA Cup semi-final on 23 April.
Fernando Llorente scored his first Tottenham goal in his 17th appearance for the club as Mauricio Pochettino's side rounded off their Champions League Group H campaign with a routine victory against Apoel.
Spurs had already secured first place in the group before Wednesday's game and Pochettino opted to give some of his fringe players a start.
Llorente, a summer signing from Swansea, was one of those to come in and he opened his Tottenham account midway through the first half, turning smartly inside the box before hooking the ball into the net.
It was a deserved goal for Spurs after a dominant start to the match, with Georges-Kevin N'Koudou having had an early effort cleared off the line.
Son Heung-min added a second before the break, curling in from the edge of the box after playing a one-two with Llorente.
Cypriots Apoel, who needed to avoid defeat to have a chance of claiming a Europa League spot ahead of Borussia Dortmund, offered very little throughout.
Also, Philippe Coutinho scored a hat-trick as Liverpool became the fifth English club to qualify for the last 16 of this season's Champions League with a thumping victory over Spartak Moscow at Anfield.
Jurgen Klopp's Group E leaders came into the game knowing they needed to avoid defeat to be sure of reaching the knockout stage for the first time since 2008-09 - and Coutinho gave them the lead with a fourth-minute penalty after Mohamed Salah was fouled by Georgi Dzhikiya.
They doubled their advantage after a superb move 11 minutes later, Coutinho tapping home from Roberto Firmino's pass.
Firmino netted himself to make it 3-0 at half-time, and Sadio Mane's sublime volley extended the lead.
Coutinho completed his first hat-trick for the club with a deflected shot, and Mane added the sixth before Salah completed the rout.
Liverpool's victory means this is the first time five English teams have qualified for the Champions League last 16 in the same season.
Real Madrid 3 -2 Borussia Dortmund
Maribor 1 - 1 Sevilla
FC Porto 5 - 2 Monaco
RasenBallsport Leipzig 1 - 2 Besiktas
Feyenoord 2 - 1 SSC Napoli
Shakhtar 2-1 Manchester City
Tottenham 3-0 Apoel
Liverpool 7-0 Spartak Moscow