After three months away because of the coronavirus pandemic, Barca exploded into the lead with just 64 seconds played when Arturo Vidal headed in and Martin Braithwaite struck a second from a Messi headed assist.
Jordi Alba latched onto a Messi pass to add a third but not before play was briefly stopped by a pitch invader, who was able to run on, despite the match being closed to fans.
Messi then scored a fourth in injury time for his 25th goal of the season.
“I’m happy because starting like this is an enormous boost for what’s to come,” said Barcelona coach Quique Setien.
The victory extends Barca’s advantage at the top of La Liga to five points over Real Madrid, who can reduce the gap back to two when they restart at home to Eibar on Sunday.
La Liga’s first match back came on Thursday between Sevilla and Real Betis, with teams scheduled to each play their remaining 11 matches of the season in less than six weeks.
Messi will be crucial to Barcelona’s hopes of holding off Madrid but their captain, who turns 33 this month, may have to pace himself, especially after an injury-interrupted season.
Clean-shaven, and without any sign of the thigh problem that prevented him from training earlier this month, Messi played 90 minutes and looked like he had never been away.
His goal was set up by Luis Suarez and the sight of the Uruguayan coming off the bench would have been welcome for coach Setien too.
Suarez has not played since undergoing knee surgery in January and was able to recover during the suspension. He could play an important part in the run-in.
Asked what pleased him most, Setien said: “The satisfaction of seeing Luis again on the field. You have to admire the performance he gave in those 35 minutes that he played. Starting like this is very important for him and for the team as well.”
Mallorca, who sit 18th in La Liga, were never going to offer the sternest of tests but this was a useful outing for both Barcelona’s fitness and morale.
Before matches were suspended in Spain because of coronavirus on March 12, Barca had regained top spot but only after being convincingly beaten by Madrid the week before.
This performance suggests time away might have done them good and it remains to be seen now how Madrid respond. Madrid’s next four matches all come after their title rivals have played first.
Barcelona were in front after just over a minute as Frenkie de Jong did well to recover the ball from a loose touch before Alba sent a deep cross to the arriving Vidal, who headed in.
Mallorca were under relentless pressure as Braithwaite and Messi both went close to adding a second. Mallorca’s Takefusa Kubo, on loan from Real Madrid, forced a good save out of Marc-Andre ter Stegen on the break.
But Barca scored a second before half-time as an Alba cross span up and both De Jong and then Messi feathered headers across for Braithwaite to bang in on the half-volley, his first goal for the club.
Both teams eased off in the second period and there were smiles on the Barcelona players’ faces when a pitch invader ran on in the 52nd minute wearing an Argentina shirt. He posed for a picture with Alba before being escorted away.
Alba added a third after finishing off Messi’s clipped ball over the top and then Messi grabbed a goal himself. Suarez fooled his marker by letting the ball run across his body and Messi weaved inside where he could unleash with his right foot.
Mallorca’s defeat, combined with losses for Leganes and Celta Vigo, made it the perfect day for Espanyol, who made up ground on their relegation rivals by beating Alaves.
Chinese striker Wu Lei, who tested positive for coronavirus in March, scored on his first game back to seal a 2-0 victory and put Espanyol within three points of safety.
They are now level on points with Leganes, who lost 2-1 at home to Real Valladolid, and three behind Celta, who conceded in the 91st minute for a 1-0 defeat by Villarreal.