Barcelona's Lionel Messi 'best player in the history of the game' - Luis Enrique

Lionel Messi produced another outrageous performance as Barcelona beat Real Madrid to move top of La Liga, scoring his 500th goal for the club in stoppage time to seal a 3-2 win.

Casemiro had opened the scoring for Madrid, but Messi equalised soon after, starting and finishing a move which left the home side's defence dazzled.

Ivan Rakitic then edged Barca ahead before Sergio Ramos was dismissed for a two-footed challenge on Messi.

Ten-man Madrid got themselves back on level terms through substitute James Rodriguez, though, setting the stage for another historic Messi moment.

"Messi even makes a difference when he's at home having dinner," Barca coach Luis Enrique told beIN Sports after the game.

"He is the best player in the history of the game, and I have seen a lot of football and a lot of videos. He makes the difference and it's a huge pleasure for all Cules to have him identify as one of us."

Asked in a news conference afterwards if Messi was the sole difference in the game, Luis Enrique added: "Of course -- that's why he plays for Barca.

"Messi's our best player. Just imagine, his 500th goal coming here, a winner in the 92nd minute at the Santiago Bernabeu. It's very nice for Leo and it's nice for everyone associated with Barca.

"He allowed us to have superiority in midfield, we wanted him on ball as often as possible. It was more difficult in the middle with lots of bodies in there, but he managed to do it for the first goal. It went as we'd hoped."

The winning goal came with the last kick of the game and was the result of a surging run from Sergi Roberto -- the hero against Paris Saint-Germain -- from the right-back position into the final third.

"Sergi Roberto's run was bestial in the last minute," Luis Enrique wanted to point out. "Not just technically, but physically. There was good play from Andre [Gomes], too, and then the assist from Jordi [Alba], and a great goal from Leo."

In the rush to praise Messi after the final whistle, there was a tweet from teammate Rafinha saying "I played with him" and midfielder Ivan Rakitic was also asked about the Argentine's brilliance.

"Messi cannot surprise anyone," the Croatian midfielder told reporters. "You can put him anywhere and he can hurt teams. We are really happy for the victory and for him, because we need him."

The win means there is still all to play for for Barcelona, and Messi acknowledged the challenge via a social media post on Monday. Barcelona were knocked out of the Champions League in midweek by Juventus and defeat in Madrid would have left them with a mountain to climb in La Liga.

Instead, the three points take them top -- although they have played a game more than Madrid -- and they also have a Copa del Rey final against Alaves to come in May.

"This season feels like five [seasons]," Luis Enrique said of his side's up and down form. "So many things have happened: good things, not so good things, things I've already forgotten.

"Madrid's second goal was a huge blow, but the players came back with their last breath. It was the happy ending we all wanted and I'm delighted with the performance, with how they battled until the last second.

"We are top now, but Madrid still have that game in hand. It will be tight and it will go right down to the wire, but we got the result we came here for."