Sofiane Feghouli’s goal was cancelled out by Thomas Muller as 10-man Valencia qualified with a 1-1 draw against Bayern Munich.
It was a straight shoot-out to see who would finish top of Group F, as with Lille's earlier win over BATE Borisov, both sides were assured of qualification.
Mauricio Pellegrino named a strong side for the visit of the Bavarian giants, but they struggled to assert their dominance early on.
Franck Ribery and Muller were causing a lot of problems down both wings, but it was a set-piece that produced the best chance in the opening exchanges. A Philipp Lahm corner found the head of Dante, but the Brazilian defender's effort forced a great save out of Vicente Guaita.
Los Che looked dangerous on the counter-attack, and they kept Manuel Neuer busy midway through the half. Feghouli struck a delightful half-volley from the edge of the area, but the German international was more than equal to it, making a superb stop.
Jupp Heynckes’ men continued to monopolise possession however, and their task was made somewhat easier on 33 minutes. Antonio Barragan made a truly horrible challenge on David Alaba, and received a second yellow card.
After the interval, the numerical advantage was clearly showing, despite the Taronja looking good on the counter – Roberto Soldado had his header saved well, but Bayern were virtually given carte blanche to pass in the middle third of the pitch.
No matter how much of the ball the Bundesliga side had though, it was the home team who were creating all the best chances. Ricardo Costa saw his header go wide on 60 minutes, and just two minutes later, Soldado should have scored his one-on-one effort, but fired over.
The substitution of Mario Mandzukic for Claudio Pizarro gave Die Roten a bit more of an edge up front, but the shooting boots had perhaps not been packed for this trip, as he couldn’t quite get on the end of Alaba’s fantastic cross.
With 13 minutes remaining however, Valencia went against all the odds and broke the deadlock - Feghouli side-stepped past two defenders, before seeing his deflected effort wrong-foot Neuer and end up in the net.
That lead could only last five minutes though, as Lahm’s cross from the right ricocheted to Muller at the far post, and the German international fired home past Guaita.
Valencia 1-1 Bayern Munich
Scorers: Feghouli 77 (V); Muller 82 (BM)
Valencia: Guaita; Barragan, R. Costa, Rami, Cissokho; T. Costa, Parejo (Jonas 75); Feghouli, Banega (Albelda 80), Guardado (Valdez 86); Soldado
Bayern Munich: Neuer; Lahm, Dante, Badstuber, Alaba; Martinez, Schweinsteiger; Muller, Kroos (Shaqiri 66), Ribery (Gomez 79); Pizarro (Mandzukic 66)
Sent off: Barragan 33 (V)