Lionel Messi scored his 500th goal for Barcelona in all competitions by netting a dramatic late winner in El Clasico.
The Argentina international had gone into Sunday's clash against Real Madrid at the Santiago Bernabeu on 498 goals after his double in last weekend's Liga win over Real Sociedad.
He drew a blank against Juventus in the Champions League in midweek, but he reached another landmark figure in a career littered with records when he scored twice in Madrid to send Barcelona top of the table after a 3-2 victory.
Messi scored his 499th goal for Barcelona with a superb individual effort on 33 minutes to cancel out Casemiro's opener for Madrid, with that effort making him the leading scorer in El Clasico in La Liga, surpassing Alfredo Di Stefano.
Ivan Rakitic's brilliant strike fired Barca in front on 73 minutes, but Madrid, who had Sergio Ramos sent off for a wild lunge on Messi, looked to have claimed a point when substitute James Rodriguez equalised with five minutes to go.
However, in the second minute of added time, Jordi Alba's low pass into the penalty area picked out Messi and he guided his shot beyond Keylor Navas to earn Barcelona the points.
Messi has spent his entire professional career at Barca, joining the Catalan club from Newell's Old Boys in 2001 when he was still only 14.
The teenage prodigy broke into the senior squad just three years later, making his Liga debut in October 2004, against Espanyol. "It seemed as if he had been playing with us all his life," enthused Barcelona's then assistant coach Henk Ten Cate.