Barcelona handed Real and Atletico Madrid the initiative in the Primera Division title race as they were beaten 3-2 at home by Valencia on Saturday.
The Catalans' misery was compounded by a sending-off for Jordi Alba as they lost for the first time at home this season.
The hosts remained top of the league on goal difference, but are likely to drop back on Sunday when both Madrid clubs are in action. Should Real and Atletico both win, Barcelona will fall to third place.
Barcelona started well as Alexis Sanchez gave them the lead in the seventh minute, but Gerardo Martino's faltering side released their early grip and went behind to goals from Dani Parejo and Pablo Piatti either side of half-time.
Lionel Messi equalised from the penalty spot, but Paco Alcacer scored the visitors' third goal on 59 minutes and this time Barcelona had no answer.
Duda scored twice as Malaga came from behind after throwing away the lead to win 3-2 at home to Sevilla in the Primera Division on Saturday.
Getafe were the width of a post away from earning a much-needed win against Real Valladolid had to settle for a 0-0 draw which hardly helps either side.
Rayo Vallecano avoided defeat for the first time in three league games by drawing 0-0 at Levante, but remained in deep trouble in the Primera Division relegation zone.