Jacobo Ramon's 95th-minute winner for Real Madrid against Mallorca forced Barcelona to wait another day at least for La Liga title glory.
Hansi Flick's side were seconds away from being confirmed as champions without playing, only for Madrid to score with practically the last kick of the game at the Bernabeu.
Barcelona will only need a point at rivals Espanyol on Thursday (20:30 BST) to wrap up the title.
Martin Valjent drilled a fine low effort to give visitors Mallorca the lead in the Spanish capital.
Hosts Real were dominant but missed a host of chances before Kylian Mbappe found the bottom corner with a well-hit strike.
They continued to miss chances before Ramon's close-range volley after some poor defending delivered the win.
Despite this comeback, the title is still highly likely to go to Barcelona, who are four points ahead at the top with a game in hand.
The league was as good as won thanks to Sunday's 4-3 Clasico win over Real, which was Barcelona's fourth victory over their rivals this season.
That includes wins in the finals of the Copa del Rey and Spanish Super Cup.
Legendary boss Carlo Ancelotti is likely to end his final season at Real Madrid without a major trophy.
He takes over as Brazil manager once this La Liga season ends, with Xabi Alonso expected to replace him in time for June's Fifa Club World Cup.
Including minor trophies, Ancelotti is the most successful boss in Real's history, with 15 pieces of silverware, including three Champions League and two La Liga wins.
His last trophy came in December, with the win over Mexican side Pachuca in the Fifa Intercontinental Cup final in Qatar, a relatively minor triumph for a club who crave the biggest prizes in the game.