Villarreal 2-3 Barcelona
Lionel Messi's late winner kept Barcelona in the Spanish title race as they marked their first match since ex-coach Tito Vilanova's death with a superb comeback win at Villarreal.
The hosts held a 2-0 lead through Cani's precise finish and a powerful 15-yard header from Manu Trigueros.
But Villarreal defenders Gabriel Paulista and Mateo Musacchio both scored own goals to put Barca level.
Messi steered in the winner from close range as Barca moved into second.
The plucky fightback, where all three goals came in the space of 18 second-half minutes, means the Catalan club are four points adrift of leaders Atletico Madrid with three matches left.
The pair go head-to-head at the Nou Camp on the final day of the La Liga season, although Atletico - who beat Valencia earlier on Sunday - will become champions for the first time since 1996 if they beat Levante and Malaga in their next two matches.
The odds are still heavily stacked against Barcelona retaining the title which they won less than 12 months ago under the guidance of Vilanova.
Vilanova was forced to quit the club last summer as he battled cancer and the 45-year-old lost his fight against the disease on Friday.
Sunday's trip to Villarreal came under difficult circumstances for the grieving Barcelona players, but they managed to reignite their title ambitions with a gutsy victory.
Villarreal's El Madrigal stadium fell quiet ahead of kick-off, with many Barcelona players close to tears as Vilanova was remembered during a minute's silence.
However, they were focused from the first whistle as they made a high-tempo start against seventh-placed Villarreal.
|La Liga title run-in|
|Atletico Madrid||Real Madrid||Barcelona|
|3-4 May||Levante (A)||Valencia (H)||Getafe (H)|
|7 May||Valladolid (A)|
|10-11 May||Malaga (H)||Celta Vigo (A)||Elche (A)|
|18 May||Barcelona (A)||Espanyol (H)||Atl. Madrid (H)|
Barcelona, as they have done on many occasions in recent weeks, controlled possession in the first half without creating many clearcut chances.
And they were punished as Villarreal took the lead on the stroke of half-time.
Home midfielder Cani was allowed to run unmarked into the Barca area from deep, before steering Jonathan Pereira's perfectly-weighted pass first time into Barca keeper Jose Manuel Pinto's bottom-left corner.
Newly-promoted Villarreal have enjoyed a productive first season back in the Spanish top-flight, looking almost assured of finishing seventh and qualifying for next season's Europa League.
Both Atletico and Real Madrid could only manage draws at El Madrigal and even a point looked unlikely for Barcelona when Trigueros was left unmarked to plant in Javier Aquino's right-wing cross.
But Barca were handed a lifeline when Dani Alves's low cross-shot hit the heel of home defender Gabriel Paulista and flew into the net.
It was a huge slice of luck for the toiling visitors - and they were handed another shortly after. Alves, who had a banana thrown at him from the home crowd in a seemingly racially-motivated incident moments earlier, was again the architect as Musacchio headed the Brazil right-back's cross past his own keeper Sergio Asenjo.
Villarreal's players looked deflated, Barcelona sensed a victory was within grasp.
Messi's free-kick forced Asenjo, on a season-long loan from Barca's title rivals Atletico, into an acrobatic stop, but the home keeper was powerless to prevent the Argentine's 40th goal of the season.
The three-time Ballon d'Or winner latched on to substitute Cesc Fabregas's cushioned header, keeping his composure to bury the winner before poignantly pointing to the sky.