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, who need only two points from their final three games to secure the title, face Espanyol at 20:30 BST on Thursday.
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.
Barcelona are four points ahead of Real 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.
"The team played very well. They fought a lot, played with a lot of intensity and it was a totally deserved victory," said Ancelotti.
"We are happy because we want to finish the season well. This game didn't start well but afterwards we did very well in all senses."

There was a plan in place
The original plan for Jacobo this season was to have him split time between Castilla and the first team, serving as an emergency backup when injuries hit.
However, a spell of physical discomfort meant he fell out of the rotation, allowing Raul Asencio to step up and seize his chance.
Asencio’s more fearless, expressive playing style has appealed to the coaching staff, who feel Jacobo could benefit from developing a similar edge.
Still, in the dressing room and among staff, Jacobo is admired. He is known as a hard worker, humble, and highly respected by those who train alongside him.
But there is also a shared view that he still lacks the high-level match experience that builds true resilience in a pressure-filled environment like the Bernabeu.
Decision to be made in the summer
Despite limited first-team minutes, several clubs in Spain’s top flight are already monitoring Jacobo’s progress. Even so, Real Madrid could opt to keep him for another season with Castilla, especially given their ongoing defensive concerns.
Even with the almost finalised signing of Dean Huijsen, Jacobo could still play a key role next season—either as depth for the first team or even as a loan candidate to gain vital experience.
There is also the possibility of him working under Xabi Alonso should Real Madrid pursue that route in the near future.
For now, the club’s technical staff will assess his future this summer. But make no mistake, as Jacobo has caught the attention of decision-makers at Real Madrid, and with the right development path, he could be one of their defensive cornerstones in the years to come.
Real Madrid may be closing in on the signing of Dean Huijsen, but according to Fabrizio Romano, their ambitions at the heart of defence do not stop there.
The Spanish giants are still keen on Arsenal centre-back William Saliba, viewing the Frenchman as their dream target despite their imminent move for Huijsen.
As things stand, Real Madrid have already secured a full agreement with Bournemouth to bring in Dean Huijsen.
The 20-year-old Spanish defender is expected to sign a five-year deal, with Los Blancos activating his €59.3 million (£50M) release clause, which will be paid in three instalments.
His representatives have already landed in Madrid to finalise the details, and the move is essentially a formality at this stage.
Ambitions do not end
However, the club’s transfer activity at centre-back is far from over. Romano reports that Real Madrid still have their eyes on Saliba, who is under contract at Arsenal until 2027.
The Gunners are reportedly working hard to extend the Frenchman’s deal, and Saliba himself has shown no real intention of leaving the club at this moment.
Still, Real Madrid remain alert. Should negotiations falter or the player opt against renewing, Madrid will be ready to pounce.
This persistent interest in both Huijsen and Saliba makes sense given the current state of Real Madrid’s defence. David Alaba has struggled to regain form and fitness after a long-term injury.
Eder Militao, another key figure, has undergone two knee surgeries in quick succession, casting doubt over his durability in the long run. While Antonio Rudiger is still reliable, he is also 32 and approaching the latter stages of his career.
Real Madrid are being cautious
With this context, it is easy to see why Real Madrid are taking no chances. Securing Huijsen is a proactive move to reinforce the defence with youth and quality, but the pursuit of Saliba shows they are aiming even higher.
At just 24, Saliba is already a standout performer in the Premier League and one of Europe’s most complete defenders. Adding a player of his calibre would give the club long-term stability in a position that has been increasingly fragile.
For now, the decision rests with Arsenal and Saliba. But if contract talks stall, Real Madrid will be waiting, ready to take their shot.