Barcelona suffered their first defeat under Xavi Hernandez on Saturday as they were beaten by Real Betis before Atletico Madrid lost at home to Mallorca in a day of shocks in La Liga.
Barca’s 1-0 loss to Betis inflicted another blow on their hopes of catching La Liga’s top four.
And Atletico’s 2-1 defeat by Mallorca was even more unexpected, given struggling Mallorca had not won a game since the start of October.
Both teams now have to pick themselves up ahead of crunch Champions League group games in midweek.
Barca need to win away at Bayern Munich to guarantee their place in the last 16 while Atletico have to beat Porto in Portugal to have a chance of going through.
Barcelona were hit by a brilliant Betis counter-attack, finished by Juanmi in the 79th minute, which consigned the Catalans to their fourth league defeat of the season.
“That goal annoyed me a lot because we had worked on those situations,” said Xavi. “We didn’t deserve to lose.”
The result will leave Barcelona 16 points behind leaders Real Madrid, if Madrid win at Real Sociedad later on Saturday while Betis moved into third to continue their excellent start to the campaign.
Atletico are fourth, now seven points behind Real Madrid, who they face next weekend at the Santiago Bernabeu.
They were undone in the 91st minute by a Real Madrid player as Takefusa Kubo, on loan at Mallorca, raced clear and coolly found the corner.
Franco Russo headed in Mallorca’s equaliser in the 80th minute after Matheus Cunha had prodded Atletico into the lead in the 68th.
Barcelona’s Gavi is unlikely to be available against Bayern after the midfielder had to be taken to hospital “according to protocol”, said the club, for a head injury.
The 17-year-old was substituted in the first half after a Hector Bellerin clearance saw the ball strike his head from close range.
Xavi had started with two wins out of two in La Liga but even he admitted the results owed a lot to good fortune, with Espaynol and then Villarreal guilty of squandering chances.
In between, a goalless draw at home to Benfica in the Champions League exposed Barcelona’s ongoing problems in front of goal and that was evident against Betis, who were relatively untroubled throughout.
Ousmane Dembele, who come on off the bench, posed the greatest threat while the 19-year-old Abde Ezzalzouli missed a golden opportunity to equalise late on, when the ball was cut back to him eight yards out. The youngster blazed over.
Minutes before, Betis showed far more composure to finish off a slick counter-attack.
Sergio Canales broke free down the right but the move appeared to have lost its momentum when Canales pulled back to Cristian Tello on the edge of the area.
Instead, Tello shifted the ball quickly left to the arriving Juanmi, who took one touch before sliding into the corner.
Earlier, Sevilla reduced the gap to Real Madrid to five points by beating Villarreal 1-0, with Lucas Ocampos scoring the winner in the first half.
Villarreal have ambitions to challenge for the top four but they remain 12th after continuing a miserable run of form away from home.
They could have sealed a draw in the second half but Gerard Moreno missed a sitter. Dani Parejo’s chipped ball was played to the back post where Moreno stood, three yards out with the net gaping, but he somehow wafted wide.