A draw would have been enough to take Swansea through from Group A with a game to spare, but they fell behind to Daniel Parejo’s 20th-minute strike and then lost striker Wilfried Bony to a worrying hamstring injury.
They thought Bony’s replacement Alvaro Vazquez had levelled just before the break when Diego Alves could not hold Jonjo Shelvey’s shot and the Spaniard tapped in, but the flag went up despite replays suggesting the two Swansea players were onside.
If the goal had stood, it would have been enough to seal a spot in the last 32, but instead Swansea must wait until their final game against St Gallen to discover their fate.
Michael Laudrup’s side are three points clear of third-placed Kuban Krasnodar, with the Russians having to go to Valencia, the group winners, in the final round and Swansea three goals better off.
Valencia were much improved from the first meeting between these two sides and deserved their lead.
Gerhard Tremmel did not deal with a Sergio Canales corner and Parejo slotted home when Juan Bernat’s deflected shot fell to him.
Parejo went close to a second and forced Tremmel into sprawling save before Swansea saw Bony head off pulling up chasing a long ball.
The key moment soon arrived as Bony’s replacement Vazquez finished from close range after Shelvey could not find the net, but the flag went up to Swansea’s fury.
And the Welsh club’s night was summed up when Jeremy Mathieu cleared a goalbound effort off the line and Angel Rangel limped off in the dying minutes.