Messi, who has not started for the Catalan powerhouse since September 26, scored twice, his opener after a sublime move involving every outfield player having a touch of the ball and nearly 30 passes.
The Argentina ace came on as a substitute in Barca's rout of Real Madrid in El Clasico Saturday,
but here he was able to weave his magic for the full 90 minutes, ably supported by the brilliance of Luis Suarez, who also grabbed a double.
"Messi is the best in the world and I'm happy for him," said Suarez after the match, but it has been the Uruguayan and Neymar who have carried the Barcelona attack in his prolonged absence.
"It felt good to play the 90 minutes. Little by little I'm feeling better," said Messi.
Gerard Pique, with a tap-in after being set up by Messi, and Adriano after a late penalty from Neymar was saved, added the other goals for the totally dominant home side.
Luis Enrique's men had already qualified for the last 16 before taking the field after BATE Borisov and Bayer Leverkusen drew 1-1 in Belarus, but needed a point to seal top spot with one round of matches still remaining.
The result was never in doubt after Suarez grabbed the opener after 15 minutes and Messi added the second, chipping in his finish.
Suarez made it 10 goals in six games just before half time with three more, including Messi's second, coming after the break.
Edin Dzeko saw a late penalty for Roma saved by Marc-Andre ter Stegen, but at least had the scant consolation of scoring an injury time goal for the Italian side.
Bayern Munich, who many see as the only team capable of mounting a challenge to Barcelona in the competition, also booked a last 16 place Tuesday after a thumping 4-0 win against Olympiakos in Germany. It is the 18th time Bayern has reached this stage in the Champions League.
Douglas Costa, Robert Lewandowski, Thomas Muller and Kingsley Coman were on target for the Bavarians, who could even afford to lose Holger Badstuber to a red card early in the second half.
Bayern's victory, which sealed top spot in Group F, also allowed Arsenal to stay in the competition as Alexis Sanchez scored twice in a 3-0 win over Dinamo Zagreb at the Emirates.
Mesut Ozil put the Gunners on the way to a vital victory, but Arsene Wenger's perennial qualifiers for the knockout stages still trail Olympiakos by three points and must next go to Greece to decide who finishes second in the group.
"We have to win. Let's forget that for now and focus on Norwich (In the EPL) on Sunday," said a relieved Wenger.
English Premier League champion Chelsea moved closer to qualification from Group G with a 4-0 win at Maccabi Tel Aviv but Dynamo Kiev's 2-0 win in Porto leaves all three teams with a chance of progressing after the final round of matches.
Elsewhere, Zenit St Petersburg continued to impress by making it five wins from five in Group H, beating Valencia 2-0 with goals from Oleg Shatov and the prolific Artem Dzyuba.
Gent, whose fans were prevented from traveling because of security fears, won 2-1 at Lyon thanks to Kalifa Coulibaly's late goal to move into second spot behind Zenit.