Lionel Messi scored his 500th career goal for Barcelona to give the Catalan club a dramatic 3-2 win over 10-man Real Madrid in the last minute of the "clasico" on Sunday, leaving the Spanish league title race wide open.