Martin Braithwaite, making his first start in the league this season, opened the scoring from close range and Antoine Griezmann added the second before half-time with a stunning volley from the edge of the box.
Philippe Coutinho scored the third after the break when he was teed up by Griezmann before Messi completed the rout for Ronald Koeman's men. Messi lashed home from 20 yards before revealing a Newell's Old Boys shirt in tribute to Maradona, the former Argentina, Napoli and Barca forward who died Wednesday.
This win, along with the 4-0 success over Dynamo Kiev in midweek, was just what was needed after last week's loss to Atletico Madrid. Barca now head into a run of six league games -- four of which will be at home -- full of confidence and back in the top half of the table. Beyond the result and the four goals, Barca played well, with a glimpse of some fast-paced, one-touch football not seen often at Camp Nou recently.
Koeman will also be happy to have seen all his four attackers on the scoresheet. Messi netted his seventh of the season, Griezmann made it four in his last six games, Braithwaite scored for the third time in a week and Coutinho was on target for the first time since returning from a hamstring injury.
Koeman may have to dust his boots off if Barca's bad luck continues in defence. Clement Lenglet began the game as the senior side's only fit centre-back but he limped off with an ankle injury in the second half, joining Gerard Pique, Ronald Araujo and Samuel Umtiti on the sidelines.
Barca, therefore, ended the game with midfielder Frenkie de Jong and the B team's Oscar Mingueza at the back. The Dutch manager will cross his fingers and hope that Lenglet won't be out for long with a non-stop schedule between now and the end of the year.
Manager rating out of 10
7 -- Koeman's decision to use Braithwaite as a fixed No. 9 and Pedri alongside Frenkie de Jong in midfield was brave but paid off. He also used his substitutes well to rest players without handing the impetus back to Osasuna.
Player ratings (1-10; 10 = best. Players introduced after 70 minutes get no rating)
GK Marc-Andre ter Stegen, 7 -- Was made to work for his clean sheet, making a string of fine saves.
DF Sergino Dest, 7 -- Another really encouraging performance from the United States international, despite being a fitness doubt before the game. Daring in attack and solid in defence.
DF Oscar Mingueza, 7 -- The youngster made one or two stray passes in dangerous areas but, overall, has been the big positive of the last week after being asked to step up due to the injury crisis in defence.
DF Clement Lenglet, 6 -- Had been knocked two or three times before eventually going off with an ankle problem.
DF Jordi Alba, 6 -- Got into some dangerous positions on the left but his crosses were often lacking quality. Helped create the opener.
MF Frenkie de Jong, 6 -- Played one sensational pass to Messi in the first half before being asked to drop back into defence after Lenglet's injury.
MF Pedri, 6 -- Played a deeper role but was as comfortable as ever in possession.
FW Antoine Griezmann, 8 -- Has looked a different player in the last week. Linked well with Messi, creating an early chance for Coutinho, before coming close to scoring himself. Eventually found the back of the net with a thumping volley and later set up Barca's third goal for Coutinho.
FW Lionel Messi, 8 -- Looked as happy in a Barca shirt as he has since trying to leave in the summer. Capped a good performance with a stunning strike in the 73rd minute.
FW Philippe Coutinho, 6 -- Missed a glorious chance to open the scoring in the first half but eventually got his goal after the break thanks to Griezmann's unselfish play.
FW Martin Braithwaite, 7 -- His presence alone opened up space behind him for Messi, Griezmann, and Coutinho to create. Also scored another poacher's goal to make it three goals in two starts this week.
MF Sergio Busquets, 6 -- Came on at half-time, making his return from a knee injury that kept him out for two weeks.
DF Junior Firpo, 6 -- Barca's defensive problems are forcing the left-back to become Mr. Versatile. Played at centre-back, briefly, in midweek and was used as a right-back here.
FW Francisco Trincao, 6 -- Set up Dembele's disallowed goal and missed the chance to score his first Barca goal when fed by Messi in the 90th minute.
FW Ousmane Dembele, 6 -- Had a goal ruled out for offside and smashed into the side netting late on.
MF Carles Alena, N/R -- Replaced the injured Lenglet, with De Jong dropping into defence.