Valencia progressed to the last 16 of the Champions League with a 1-0 win at Ajax, who will play in the Europa League in 2020 after finishing third in Group H.
Rodrigo Moreno scored the only goal in the first half as Albert Celades' men secured a surprise victory that means they finish top of the group, ahead of Chelsea in second spot, despite Gabriel's late red card.
Ajax reached the semi-finals last season, knocking out Real Madrid and Juventus during a thrilling run, but they were edged out by the LaLiga side at the Johan Cruijff Arena on Wednesday.
Rodrigo headed wide in the second minute but scored the decisive goal midway through the first half, taking advantage of Joel Veltman playing him onside.
Ferran Torres shaped to shoot from outside the box but instead played a clever disguised pass into the feet of Rodrigo, who fired into the roof of the net.
Jaume Domenech reacted well to keep out a cross-shot from Hakim Ziyech that looked to be curling inside the far post, then Andre Onana denied Rodrigo at the other end.
Rodrigo continued to offer Valencia's main threat and went close again in the 55th minute, and Ziyech wasted a clear chance from six yards as Ajax grew increasingly nervous.
Noa Lang's acrobatic effort flew wide before Erik ten Hag sent on Klaas Jan Huntelaar, and Domenech had to save from Lisandro Martinez and Ziyech at the death.
Gabriel then saw red for appearing to headbutt Ajax captain Dusan Tadic in added time, but the 10 men held on to qualify.
What does it mean? Europa League beckons for Ajax
Ajax started the campaign with successive 3-0 wins, putting themselves in a dominant position, but they will play in the Europa League next year despite collecting 10 points.
The sales of Frenkie de Jong and Matthijs de Ligt to Barcelona and Juventus respectively sapped the Eredivisie giants of their star power, with Valencia recovering from their 3-0 home loss in the reverse fixture to squeeze through.
Rodrigo stars in shock win
Spain striker Rodrigo hit the only goal in a 1-0 win away to Chelsea at the start of the group stage, and his strike on Tuesday again made the difference for Valencia.
Ziyech sitter costs Ajax
Few clear chances were created by the hosts, with the best of them falling to Ziyech midway through the second half. Set up by Donny van de Beek, Ziyech did not even hit the target from eight yards out, slicing his first-time shot wide of the post.
Real Madrid visit Valencia in LaLiga on Sunday, the same day Eredivisie leaders Ajax go to AZ.