Four days after affirming its European credentials by toppling Manchester City, Barcelona slumped to a stinging 3-1 loss at Real Sociedad to relinquish the provisional Spanish league lead to Real Madrid on Saturday.
Gareth Bale scored a blistering long-range strike to help Madrid brush aside Elche 3-0 at home, and Barcelona was unable to match that with a win. Instead, it was overrun by Sociedad's dynamic attack led by forwards Antoine Griezmann and Carlos Vela.
Barcelona's defeat confirmed the change in course in the league title race over the past two months, leaving Madrid in command and waiting to see if Atletico can keep up when it visits Osasuna on Sunday. After starting the season with 13 wins and a draw, Barcelona has dropped points in four of its last seven games.
Barcelona coach Gerard Martino shuffled his lineup from Tuesday's Champions League victory at City and tried to reinforce his defence by playing with two holding midfielders in Sergio Busquets and Alex Song.
The move backfired when Song scored an own goal in the 32nd minute in the first of several defensive lapses that doomed the defending champions.
Lionel Messi equalized in the 36th, only for Griezmann to restore the hosts' advantage after an error by defender Marc Bartra in the 54th before setting up David Zurutuza in the 59th.
The loss left Barcelona three points behind Madrid, the first time it has trailed its fierce rival this season. Atletico is also three points behind Madrid before it plays on Sunday.
The last time Barcelona lost by more than one goal was a 3-0 defeat to Bayern Munich in May 2013.
Martino took the blame for the humbling defeat.
"Real (Sociedad) deserved to win," he said. "I didn't make the correct reading of the game. The decision not to change was also a mistake."
Madrid won its third straight game without Cristiano Ronaldo, who was finishing a three-game suspension.
Madrid midfielder Asier Illarramendi opened the scoring at the Santiago Bernabeu in the 34th. Bale then squashed Elche's timid second-half surge with a blast from about 25 metres in the 72nd before substitute Isco Alarcon sealed the victory in the 81st.
Bale was having a discreet outing until his superb strike that hit the underside of the bar and bounced in, securing the three points that made Madrid the overnight pacesetters.
"I said 'My goodness, what a goal' when I saw the ball pass by," Madrid fullback Dani Carvajal said.
Madrid will visit Schalke 04 on Wednesday in the Champions League final 16 enjoying an unbeaten streak of 26 games in all competitions. Madrid then plays at crosstown rival Atletico next weekend in a highly anticipated league meeting.
Also, Celta Vigo fought back for a 1-1 draw at home against 10-man Getafe to leave the visitors winless in the last 10 rounds, while Malaga drew 0-0 at Almeria.
Martino was dismissed by the referee during halftime, and Barcelona's first-year manager had to witness the rare sight of his team being thoroughly dismantled from the Anoeta Stadium stands as the festive home fans soaked up their big win.
The victory moved Sociedad one point out of fourth place and Spain's last Champions League spot as the Basque side deployed its best version of its up-tempo attack to take a good measure of vengeance for Barcelona eliminating it from the Copa del Rey the previous week.
Sociedad was unlucky not to widen the final margin when a disheartened Barcelona appeared to tire in the final minutes. Vela almost capped his outstanding performance in the 81st but his shot hit the post.
Sociedad went ahead when Gorka Elustondo muscled by Song to meet Sergio Canales' cross, which Elustondo appeared to graze with his head before it hit Song in the chest and landed in the net.
Messi combined with Martin Montoya to level when Sergio Busquets craftily let Montoya's pass run between his legs for Messi to rifle it inside the upright of Claudio Bravo's goal.
Sociedad, however, got the winner when Bartra headed Bravo's goalkick back toward his own area, where Vela was quick to pounce and crossed for Griezmann to volley in his 15th league goal of the season.