MADRID: Lionel Messi scored his 500th Barcelona goal with the last kick of the game to snatch a stunning 3-2 win at Real Madrid and put the two teams level on points at the top of La Liga.

James Rodriguez appeared to have rescued a point for the hosts with an 86th minute strike to make it 2-2 after goals by Messi and Ivan Rakitic had overturned Casemiro’s opener.

Madrid captain Sergio Ramos was sent off for a two-footed lunge on Messi in the 77th minute and that left Barcelona in a strong position, until Rodriguez fired home at the near post.

But Messi’s second goal in the final minute of added time earned Barca a vital win in the title race that leaves both sides with 75 points, although Madrid have a game in hand.

Messi has scored more goals in the Clasico – 23 – than any other player, ahead of Alfredo Di Stéfano (18), Cristiano Ronaldo (16), Raul Gonzalez Blanco (15) and Cesar Rodriguez (14).