Barca will play Bayern Munich in the last eight after the German champion completed a 7-1 aggregate win over Chelsea.
With the series level at 1-1 from the first leg in Naples, Barcelona made the perfect start as Clement Lenglet headed home an Ivan Rakitic corner in the 10th minute.
Messi increased the lead in the 23rd with a goal outrageous even by his standards, slaloming past several defenders after cutting in from the right before squeezing his shot home.
Messi also played a big part in Barca’s third, being hacked down by Kalidou Koulibaly, the penalty awarded after a VAR check.
Luis Suarez stepped up to take the penalty and put the home side 3-0 ahead.
Napoli revived its hopes when Dries Mertens, who had gone close at the start of the match, was fouled by Rakitic in the penalty area
Lorenzo Insigne converted the spot kick, but despite some visitor pressure in the second half, with Arkadiusz Milik’s header 10 minutes from the end ruled out, there were no further goals as the home side defended its lead comfortably enough.
The result will be a relief for under pressure Barca coach Quique Setien.
His side had gone into the match with rumblings of discontent, with Messi himself describing the team as “weak” after a defeat to Osasuna in the penultimate game of the season.
With arch-rival Real Madrid pulling away after the restart to win La Liga, the Champions League represents the last chance of silverware for the Catalan giants this season amid further rumors about Messi’s future if the campaign ends in failure.
Bayern thrashes Chelsea
Meanwhile, in the other match on Saturday, Bayern Munich romped to a 4-1 win over Chelsea in the Allianz Arena with Robert Lewandowski scoring twice.
The Polish star made it 53 overall for the season and assisted on two more goals as Bayern, leading 3-0 from the first leg back in February, cruised into the quarterfinals in some style.
Lewandowski was upended by Willy Caballero in the Chelsea goal early in the first half, scoring from the penalty spot before setting up the second for Ivan Perisic.
Tammy Abraham pulled one back for Chelsea with his 18th of the season just before halftime, but it proved only temporary relief for Frank Lampard’s men as further goals from Corentin Tolisso and the deadly Lewandowski settled a one-sided affair.