Lionel Messi had a brace in Barcelona's 3-2 win over Real Madrid that will send La Liga into the final weeks of the season.

Madrid scored the opening goal in the 28th minute when Casemiro tapped in a rebound off a Sergio Ramos shot that came off the post.

Barcelona scored three minutes later when Messi took three fast touches before beating Keylor Navas. Messi had a bandage in his mouth as he was bleeding after a Marcelo elbow.

Ivan Rakitic scored from outside the box in the 73rd minute with a brilliant strike.

Sergio Ramos was sent off with a straight red after a reckless challenge on Messi that brought Madrid down to 10 men. But James Rodriguez scored in the 85th minute, converting a cross from Marcelo.

Madrid continued to go for the win as time was running out despite only having 10 men on the pitch and overextended themselves, which allowed Barcelona to counter and eventually found Messi on a run that he calmly converted. Messi took off his jersey and held it up to the Bernabeu crowd.