Real Madrid earned their first La Liga victory under interim coach Santiago Solari, claiming a 2-0 win at home to Real Valladolid on Saturday.
Barcelona appeared on their way to defeat as they trailed at Rayo Vallecano deep in the second half, but two goals in the final three minutes for the away side gave the Spanish champions a 3-2 win.
Valencia's disappointing start to the season continued as they were beaten 1-0 by Girona at home.
Atletico Madrid looked set to take three points at Leganes, but a late equaliser gave the hosts a 1-1 draw.