Barcelona's Neymar was sent off as they suffered a surprise 2-0 defeat at Malaga on Saturday that scuppered their hopes of going top of La Liga.
Former Barcelona striker Sandro Ramirez opened the scoring with a breakaway goal in the 32nd minute before Jony added a 90th-minute second for the hosts.
Neymar was shown two yellow cards and dismissed midway through the second half as Barcelona handed control of the title race back to Real Madrid, who are three points ahead with a game in hand.
Los Blancos drew 1-1 with Atletico Madrid in the derby clash earlier on Saturday and a victory at La Rosaleda would have sent Barcelona top on goal difference.
(Reporting by Rik Sharma; Editing by Toby Davis)