Barcelona surrendered the LaLiga title to Real Madrid as Luis Enrique's Camp Nou farewell was marked by a thrilling 4-2 come-from-behind victory over 10-man Eibar.
The Catalans needed to win and then hope Madrid lost at Malaga in order to secure a third consecutive league championship, but Zinedine Zidane's side held their nerve to prevail 2-0.
Barca – seeking a 12th straight top-flight home win – were stunned by Takashi Inui's seventh-minute opener, a fine finish that ricocheted in off the underside of the crossbar.
Luis Suarez spurned two glorious chances to level before the interval, with Eibar goalkeeper Yoel helping to preserve a shock lead, while fortune favoured Jose Luis Mendilibar's side when Lionel Messi somehow scuffed wide from six yards in the second half.
That proved costly when Inui crashed in his second off the frame of the goal, but it stirred Barca into life and David Junca's own goal cut the deficit in the 63rd minute.
A blatant dive from Jordi Alba fooled referee Alejandro Hernandez into awarding a penalty, but Yoel acrobatically kept out Messi's effort, only for Suarez to level it up three minutes later.
Messi then atoned for his spot-kick failure by converting another after Neymar had been fouled by Ander Capa, whose red card added to the drama before Messi's late solo goal sealed it.
The home side were without defensive trio Gerard Pique, Javier Mascherano and Jeremy Mathieu, meaning Marlon Santos was selected once more.
It quickly became apparent that Madrid, who needed only a draw, had taken the lead, sapping the optimism out of the Camp Nou crowd.
That sense of impending disappointment grew when Inui fired a first-time shot beyond Marc-Andre ter Stegen from Capa's searching cross.
Suarez contrived to fire wide at the other end immediately after, having raced clear with only the goalkeeper to beat.
The Uruguayan proved more accurate in the 14th minute, but his goal was ruled out after Alba was adjudged to have strayed offside in the build-up.
Neymar had speculative appeals for a penalty waved away as he went down under minimal contact from Junca.
A Sergi Roberto volley called Yoel into his first meaningful action after 33 minutes and the Valencia loanee did brilliantly to repel Suarez's low shot soon after.
Ruben Pena could have made matters even worse for Luis Enrique's men in the final minute of the half, but he failed to turn home the rebound from Inui's saved effort.
There was no sign of Eibar trying simply to protect their advantage in the second half, with the lively Inui denied from a tight angle inside 90 seconds of the restart.
It heralded an open start to the second period and Yoel saved smartly from Andres Iniesta's 18-yard drive before keeping out another strike from the Spain legend.
Barca were 4-0 winners in January's reverse fixture, but somehow a breakthrough continued to elude them, Messi remarkably side-footing wide from close range with Yoel laying helplessly on the floor after Suarez's square pass.
That abysmal miss was punished soon after as Inui again confounded Ter Stegen with a rifled shot that cannoned in off the bar to leave the home crowd in disbelief.
They were given a timely boost when Neymar's shot came off the foot of the post and rebounded in off the unfortunate Junca, but Barca then suffered a blow when Messi's penalty was superbly saved, which offered Eibar some justice after Alba's play acting.
Still Barca refused to relent and Suarez turned in from point-blank range after Paco Alcacer flicked on a corner, and Messi made no mistake from the spot in the 75th minute, before adding his 37th LaLiga goal at the end of a fine solo run in stoppage time.
Luis Enrique will now hope to sign off with silverware in the Copa del Rey final against Alaves next weekend.
Key Opta stats:
- Lionel Messi is the third player to be LaLiga top scorer in five different seasons with the same side, after Telmo Zarra (six with Athletic Bilbao) and Alfredo Di Stefano (five with Real Madrid).
- Barcelona have scored 116 goals in this La Liga season, surpassing their best record in a single campaign (115 in season 2012-13).
- Messi has missed his first penalty this season in all competitions (nine scored from 10 attempts).
- Takashi Inui has become the first Japanese player to score against Barcelona in LaLiga history.
- Neymar has won 15 penalties in LaLiga, at least six more than any other player since his Barcelona debut (season 2013-14).