Messi double keeps Barca on course
Any thoughts that tired limbs or damaged morale might affect the defence of their league title were misplaced as Messi, Xavi and Bojan Krkic netted in the first half at the Madrigal.
World Player of the Year Messi then bagged his second goal near the end to take his league tally for the season to 29 after Joseba Llorente had pulled one back for the hosts.
"It was a tough game and we needed to turn the page so I must congratulate the coach and players," Barca president Joan Laporta told Spanish television.
Villarreal striker Nilmar fluffed two early chances before the visitors took control.
Barca coach Pep Guardiola left Zlatan Ibrahimovic on the bench, preferring Bojan alongside Pedro and Messi up front, and it was the Argentine who showed excellent skill to score the opener.
Controlling Xavi's pass on the turn after 19 minutes he advanced and his shot deflected in off a defender.
Xavi doubled the lead with a curling free kick after 34 minutes and Bojan scored a wonderful third, spinning away from his marker and beating a second defender for pace before firing the ball into the far corner.
Llorente's goal on the counter threatened to ignite a Villarreal comeback in the 67th minute but Messi clipped the ball over the diving Diego Lopez to secure the points.
Earlier, Nikola Zigic scored twice to lead Valencia to a 2-0 victory at Espanyol that strengthened their hold on third place and Spain's last automatic Champions League qualification slot.
The towering Serbia striker, who will play at the World Cup in June, replaced David Villa early in the second half and changed the course of the game by netting twice from Vicente crosses in the 61st and 74th minutes.
Mario Bermejo headed a last-gasp winner for Xerez to earn the basement club a dramatic 2-1 victory at home to Almeria that kept alive their hopes of avoiding relegation.
Television replays showed the Xerez striker was offside when he scored in the 93rd minute to set off wild celebrations around the stadium, and scuffles between the rival players as the final whistle blew straight after.
The top-flight debutants played the whole of the second-half with 10 men and in an increasingly desperate atmosphere Almeria also had a player sent off in the closing stages.
Xerez stay bottom on 30 points but closed to within five of 17th-placed Malaga and safety.
Felipe Caicedo grabbed a late equaliser to keep Malaga out of the bottom three with a 1-1 draw at home to Sporting Gijon but they are now level on 35 points with 18th-placed Tenerife.
The islanders, who have an inferior head-to-head record, were 2-1 winners over Racing Santander and moved above Real Valladolid (33 points) who drew 0-0 at home to Getafe.