The draw interrupted the La Liga leaders’ streak of eight consecutive league wins.
Valencia, who hit the woodwork in the second minute, went ahead in the 24th minute with a well-taken finish from French forward Kevin Gameiro.
They doubled their lead with a powerful penalty kick from Dani Parejo in the 32nd minute.
Messi halved the deficit seven minutes later by scoring for the ninth consecutive game in all competitions.
The Argentinian converted from the penalty spot after having a goal chalked off as the referee had already blown his whistle to award the penalty.
Barca’s insatiable captain equalised in the 64th with an unstoppable curling strike from outside the area, averting a first league loss for the league leaders since November.
The draw also took the defending champions on to 50 points from 22 games.
Ernesto Valverde’s side are six points ahead of nearest challengers Atletico Madrid, who visit Real Betis on Sunday.
They are also 11 points clear of third-placed Real Madrid, who also host Alaves on Sunday.