PAOK Salonika secured top spot in Europa League Group A with a 1-1 draw which was also enough for Rubin Kazan to reach the last 32 by finishing second.
Rubin goalkeeper Sergei Ryzhikov was sent off in the 12th minute for what was deemed a professional foul on Georgios Georgiadis and Vieirinha tucked away the spot-kick.
At that point Tottenham, who needed a six-goal swing to edge Rubin out of second spot, might have been hopeful but Nelson Valdez's equaliser early in the second half took the Russians through.
An opportunity almost opened up for Valdez in the ninth minute after a PAOK defensive mix-up, but the ball just ran away from the Paraguayan as he seemed set to burst through on goal.
The match swung decisively in PAOK's favour with the dismissal of Ryzhikov. Vieirinha was kept waiting three minutes to take the resulting penalty as substitute goalkeeper Giedrius Arlauskis came on, but the Portuguese made no mistake with a penalty drilled low to the new man's right.
Argentinian left-back Cristian Ansaldi's daisy-cutter from long range for Rubin was easily gathered by PAOK goalkeeper Panagiotis Glikos, while Arlauskis then gave his team-mates a scare after initially fumbling a cross from the left by Vieirinha.
Rubin wasted another chance as Ansaldi's cross from the left was volleyed high over the top by the onrushing Ecuadorian Cristian Noboa after 23 minutes.
PAOK were content to play their patient passing game as they looked sure of being group winners, while Rubin were clearly determined not to let the deficit widen. Defender Bruno Cirillo fired an ambitious shot wide of Arlauskis' right-hand post in first-half injury time in a rare effort on goal.
Rubin made the perfect start to the second half as Valdez received possession from Bebras Natcho from the right and despatched a shot home from 12 yards in the 48th minute.
Arlauskis then produced a stunning save to keep the match level nine minutes later, getting down brilliantly to his left to parry away Georgiadis' powerful right-foot strike after Vieirinha's cross from the right picked him out.
The pace of the game slowed, with the draw suiting both sides, although PAOK did not sit back and came agonisingly close to a winner in the final minute of normal time when substitute Giorgos Fotakis headed Lino's cross from the left just over.