La Liga: Barcelona 3 Villarreal 2
Barca twice fell behind at Camp Nou, but fought back strongly to seal all three points and end Villarreal's 18-match unbeaten run in all competitions.
It looked as though they might extend that sequence when on-loan Real Madrid man Denis Cheryshev put Villarreal ahead in the 30th minute, but Neymar brought the hosts level on the stroke of half-time.
Luciano Vietto restored Villarreal's lead soon after the break, but goals three minutes apart from Rafinha and Messi put Barca in control.
Rafinha's effort was a scrappy affair, but Messi's - his 22nd goal in La Liga this season – was typically anything but as he caressed the ball into the net from the edge of the box.
The win moves Luis Enrique's side back to within one point of fierce rivals Real Madrid at the Liga summit, after Carlo Ancelotti's side thumped Real Sociedad 4-1 on Saturday.
Barca made a bright start, as Sergio Asenjo clawed away Luis Suarez's first-time effort from the edge of the box, before the Uruguayan shot narrowly wide of the right-hand post.
For all Barca's pressure, Villarreal took a surprise lead on the half-hour mark with their first attack of note.
A loose ball on the edge of the box fell to Mario, whose wayward shot was heading well wide of the target until Cheryshev stuck out a leg and diverted the ball goalwards, wrongfooting Claudio Bravo.
Just when it appeared the visitors would reach the interval unscathed, they came undone in the final minute of the half as Neymar converted after Asenjo parried Rafinha's initial effort back into danger.
Far from being downhearted by that blow, Villarreal retook the lead in the 51st minute.
Gerard Pique's mistake allowed Giovani dos Santos to race to the byline and cut back inside his former Barca colleague before squaring the ball for Vietto to sweep home from close range.
Any worries Luis Enrique had were soon eased though as Barca roared back.
First, Suarez crossed for Messi whose header was blocked in front of goal, but Rafinha nipped in to smash home his maiden Liga goal for Barca on the rebound.
Two minutes later, Jordi Alba's pass found Suarez, who again fed Messi, only this time the Argentina star was not to be denied, curling a delightful right-foot finish into the top corner from 18 yards.
In a breathless period of play, Villarreal's Victor Ruiz had a goal ruled out for offside before Barca broke upfield at pace.
Neymar's appeals for a penalty were turned away as he tumbled over Asenjo's challenge one-on-one, and Suarez inexplicably headed wide from point-blank range as play went on.
That miss proved academic, however, as Barca comfortably saw out the game to record their eight successive victory in all competitions.