Reeling Real fall eight points behind Barca
Barcelona maintained their unbeaten start to the La Liga season with a hard-fought win at Athletic Bilbao.
Lionel Messi somehow hit the post after going round Athletic keeper but then stroked in the opener on 36 minutes.
The hosts dominated the second half, with Raul Garcia heading against the bar and Aritz Aduriz drawing a sharp save from Marc-Andre ter Stegen.
But Athletic were caught on the counter late on as Paulinho, who hit the bar in the first half, slotted in.
Champions Real Madrid suffered an embarrassing defeat at La Liga first-timers Girona and are now eight points behind league leaders Barcelona.
Midfielder Portu back-heeled in the winner in the second half, four minutes after ex-Middlesbrough striker Cristhian Stuani's equaliser.
Elsewhere, Napoli maintained their unbeaten start to the Serie A season and pulled three points clear at the top of the table by beating strugglers Sassuolo.
Belgian Dries Mertens netted his 10th league goal of the season, with Allan and Jose Callejon also scoring.
Napoli host Manchester City in the Champions League on Wednesday.
Robert Lewandowski hopes to be available for Bayern Munich's Champions League clash with Celtic, despite suffering a minor injury on Saturday. Injuries to Thomas Muller and Franck Ribery have left Bayern short of attacking options and Lewandowski's substitution late in the first half of the 2-0 win over Leipzig was another concern for them.
Midfielder Arturo Vidal took his place as Bayern played without a recognised striker in the second half, but the Poland striker insists his withdrawal was merely a precaution.
Lewandowski and James Rodriguez scored Bayern's goals.