Messi equalled Pele‘s record of 643 goals for a single club, but Maxi Gomez prodded in to snatch a draw for Valencia, condemning Barcelona to their seventh match without a win in just 13 LaLiga matches this season.
Mouctar Diakhaby had headed Valencia into the lead, before Messi equalised – heading home almost immediately after missing a penalty.
Ronald Araujo’s acrobatic scissor-kick had Barca eyeing victory just ahead of the hour.
But Ronald Koeman’s side could not hold out, slipping to another dispiriting result made all the more frustrating off the back of consecutive victories.
Barcelona are languishing fifth in the top-flight table but could yet be overhauled by sixth-placed Sevilla who have two games in hand on the Catalan giants.
Messi has now matched Pele’s 643-goal tally that the Brazil star racked up across 19 seasons for Santos.
Argentina forward Messi’s stunning career haul for Barcelona was overshadowed by the club’s draw however, with boss Koeman still under intense pressure in the role.
Diakhaby capitalised on awful Barcelona defending to head in a corner that put Valencia into an early lead.
The hosts could not force their way back into the contest during a frustrating first-half, only to be handed the golden chance to level with a penalty.
Messi missing the penalty was the last thing on anyone’s mind, especially with Pele’s record in his sights.
But though the Argentina stalwart fluffed his lines he was still able to ride out that blow, quickly converting converting Jordi Alba’s deflected cross as the ball stayed alive after his missed spot-kick.
Barcelona thought they were on course for victory when Araujo’s acrobatics seized a 2-1 advantage with little more than half an hour to play.
But then up popped Gomez to seal the draw, heaping yet more misery on Barcelona and Koeman – and taking the shine off Messi’s latest landmark day.
Additional reporting by PA.