La Liga leaders Barcelona fell to a first home defeat in any competition for more than two years when they were beaten 4-3 by Real Betis at the Nou Camp on Sunday despite Lionel Messi returning from injury, while Ivan Rakitic was sent off for the Catalans.
Messi had been out with a broken arm, but despite his return it was a losing night for Barca.
Betis's livewire winger Junior gave the visitors a deserved lead in the 20th minute, finishing off a counter-attack that had started in their own penalty area, while captain Joaquin doubled their lead in the 35th after another venture down the wing from Junior.
Messi pulled Barca back into the game by converting a penalty midway through the second half but Betis restored their two-goal cushion through Giovani Lo Celso with the help of an uncharacteristic error from Barca's goalkeeper Marc-Andre ter Stegen who fumbled the shot into the net.
Arturo Vidal quickly responded with a goal down the other end but Rakitic was then dismissed for a second booking and Sergio Canales soon made it 4-2, sliding to the floor to knock in a pass from the electric Junior.
Messi scored from close range in stoppage time but Betis hung on to clinch a first league win at the Nou Camp since 1998.
The defeat leaves Barca on 24 points after 12 games, one ahead of nearest challengers Atletico Madrid in second - who are also their next opponents - and Alaves in third.
It was the Catalans' first defeat at home since they were beaten 2-1 by Alaves in September 2016 and the first time they have conceded four goals in a league game since they were beaten 4-2 by Deportivo La Coruna in April 2003.