Lionel Messi’s 500th career goal could not prevent stumbling leaders Barcelona suffering a third successive La Liga defeat for the first time since 2003.
Ivan Rakitic deflected Guilherme Siqueira’s cross-shot into his own net to give Valencia a shock lead.
Santi Mina then finished a terrific move by slotting in a second goal in first-half stoppage time.
Messi ended a club goal drought of 515 minutes, but Barcelona now only lead Atletico Madrid on goal difference.
Barcelona’s bubble bursts?
Luis Suarez has scored once in his last six La Liga appearances
Luis Enrique’s side began April with a nine-point lead over second-placed Atletico, but their season has crumbled since then, with defeat against Real Madrid in El Clasico marking the start of a dreadful run.
It was Atletico who ended Barcelona’s chances of retaining the Champions League in midweek, and who drew level at the top of La Liga with a comfortable 3-0 victory over Granada earlier on Sunday.
Barca, playing the 53rd match of a draining season that included a trip to Japan in December to win the Club World Cup, looked weary and short of ideas as they attempted to fight back from a 2-0 half-time deficit.
They could lose top spot if they fail to win at Deportivo La Coruna on Wednesday, with Atletico visiting Athletic Bilbao on the same night, and Real Madrid – just a point behind in third place – also in action, at home to Villarreal.
Messi’s big moment falls flat
When Messi scored for Barcelona in a Champions League victory over Arsenal on 16 March, few expected he would have to wait more than a month to find the net for his club again.
The forward did score his 499th career goal in the meantime – a penalty for Argentina in a 2-0 World Cup qualifying win over Bolivia on 30 March.
How he did it – Messi landmark in stats and graphics
But his form for Barca has dipped at the same time as their fortunes, and he has suffered his longest run without scoring for Barcelona since 2008.
Messi was denied three times in the first half as the home side created a host of chances without taking advantage.
Eventually, he did score – turning in Jordi Alba’s pull-back from the left – but with Barca two goals down by that stage, there was little reason for the reigning world footballer of the year to celebrate his landmark achievement.