Lionel Messi scored twice as Barcelona won a dramatic showdown with Valencia 4-2 to cut the gap to LaLiga leaders Real Madrid to two points.

Barca were desperate for a victory to keep the pressure on Real after handing the initiative to their rivals following last weekend's surprise defeat at Deportivo La Coruna.

But they were given a huge scare by Valencia, who took the lead through a header from on-loan Manchester City defender Eliaquim Mangala.

Barcelona vs Valencia player ratings Show all 22 1 /22 Barcelona vs Valencia player ratings Barcelona vs Valencia player ratings ter-stegen.jpg Getty Barcelona vs Valencia player ratings mascherano.jpg Getty Barcelona vs Valencia player ratings pique.jpg Getty Barcelona vs Valencia player ratings umtiti.jpg Getty Barcelona vs Valencia player ratings busquets.jpg Getty Barcelona vs Valencia player ratings rakitic.jpg Getty Barcelona vs Valencia player ratings iniesta.jpg Getty Barcelona vs Valencia player ratings rafinha.jpg Getty Barcelona vs Valencia player ratings messi.jpg Getty Barcelona vs Valencia player ratings neymar.jpg Neymar and Eliaquim Mangala vie for the ball at the Camp Nou Getty Barcelona vs Valencia player ratings suarez.jpg Getty Barcelona vs Valencia player ratings alves.jpg Getty Barcelona vs Valencia player ratings montoya.jpg Getty Barcelona vs Valencia player ratings garay.jpg Getty Barcelona vs Valencia player ratings mangala.jpg Getty Barcelona vs Valencia player ratings gaya.jpg Getty Barcelona vs Valencia player ratings parejo.jpg Getty Barcelona vs Valencia player ratings soler.jpg Getty Barcelona vs Valencia player ratings perez.jpg Getty Barcelona vs Valencia player ratings cancelo.jpg Getty Barcelona vs Valencia player ratings orellana.jpg Getty Barcelona vs Valencia player ratings munir.jpg Munir is finally set to cut ties with Barcelona and Sevilla are close to agreeing a deal Getty

However, the lead lasted just six minutes before Neymar's quick throw-in caught the Valencia defence napping and Luis Suarez raced through to equalise.

A minute before half-time Mangala felled Suarez in the area to earn his marching orders and Messi tucked away the spot-kick.

But the drama did not end there as the 10 men immediately hauled themselves level, with Barca's own player doing the damage.

This time Barcelona switched off at the back and Jose Luis Gaya squared for on-loan winger Munir El Haddadi to find the net, prompting a distinctly muted celebration.

But eight minutes after the break Messi fired the hosts back in front, wriggling past Aymen Abdennour before beating Diego Alves at his near post.

Barca wrapped up a vital victory two minutes from the end when Neymar burst down the left and picked out Andre Gomes for a tap-in.