(CNN) -- The Spanish title race might have taken another twist Saturday when Barcelona visited mid-table Espanyol in the Catalan derby. For more than 75 minutes, the home team blanked Lionel Messi and the rest of the Barcelona attack.
But just like in El Clasico on Sunday, Messi had the last word as he struck a late penalty to give Barcelona a 1-0 victory and all three points.
His goal in the 77th minute over Espanyol temporarily put Barcelona two points atop the league standings ahead of Atletico Madrid but Atletico later rallied to defeat Athletic Bilbao 2-1 to regain its one-point advantage.
Messi and Neymar missed good chances in the first half, while Espanyol's Pizzi also squandered a fine opportunity.
But there were fewer chances in the second half, although Barcelona defender Gerard Pique struck the crossbar.
With time running out, referee Clos Gomez ruled that Espanyol's Javi Lopez handled in the area and Messi made no mistake from the spot.
Lopez then had to play goalkeeper after Francisco Casilla's handball outside the area stopped a Messi shot in the 83rd minute. Casilla was shown a straight red and Espanyol had already used all three of its substitutes.
Iker Muniain put fourth-place Athletic ahead but Diego Costa leveled in the 22nd minute and Koke got the winner in the 55th. Aymeric Laporte saw red for hauling down Costa in the dying stages.
Real Madrid, reeling from defeats to Barcelona and Sevilla, had its own derby late Saturday. It blanked Rayo Vallecano 5-0, getting two goals from Gareth Bale, and once again moved to within three points of Atletico.
Barcelona and Atletico square off in the first leg of their Champions League quarterfinal next week.
Rare stumble by Bayern
Under-strength Bayern Munich finally dropped points in Germany's Bundesliga, drawing Hoffenheim 3-3 to end a 19-match league winning streak that dated back to October.
Bayern wrapped up the league title in record time this week and faces Manchester United in the Champions League quarterfinals Tuesday but it appeared as if Pep Guardiola's men were focused enough to claim three more points.
It led 3-1 -- at home -- only for Sejad Salihovic to pull a goal back and Roberto Firmino to equalize in the 75th minute. To make matters worse, Spanish international midfielder Thiago Alcantara suffered a knee injury.
Borussia Dortmund, which meets Real Madrid in the Champions League, maintained second place with a morale boosting 3-2 win at Stuttgart thanks to Marco Reus' hat-trick.
Stuttgart led 2-1 but Georg Niedermeier conceded a penalty and received a second yellow in the 67th minute.
Reus converted and added the winner in the 82nd minute.