Barcelona set up a Champions League quarter-final against Bayern Munich after overcoming Napoli on a night of high VAR drama at the Nou Camp.
The Argentine had a possible second disallowed by VAR for handball but was later awarded a penalty by the video referee after being brought down by Kalidou Koulibaly, allowing Luis Suarez to step up to make it 3-1 on the night.
Quique Setien's hosts scored three times through Clement Lenglet, Lionel Messi and Luis Suarez in an incident-packed first half, during which Messi was also denied a second for handball.
With the tie evenly poised at 1-1 after February's first leg, Messi produced a mazy run and sublime finish to double his side's lead on the night following Lenglet's headed opener.
The first-half drama was not over there, as Ivan Rakitic conceded a penalty for a foul on Mertens and Lorenzo Insigne converted for Napoli in the fifth minute of injury time.
In a significantly quieter second period, Lorenzo Insigne failed to test Marc-Andre ter Stegen with a header as the visitors chased a lifeline, while substitute Arkadiusz Milik was on the pitch for less than two minutes when he saw a goal ruled out for offside in the closing stages.
German champions Bayern Munich await Barca in the last eight after beating Chelsea 4-1 on Saturday to complete a 7-1 aggregate victory.
"This was the first forward step we wanted and now it is to be hoped we play the matches in front of us with the same attitude which we demonstrated here," Barcelona manager Quique Setien said.
"The team played well and we deserved this. All the rivals who are left are strong and there are only complicated matches left. It will be tough for us but for Bayern too. They're a great side but so are we."
Barcelona boss Setien was adamant in the build-up to Saturday's game that "at no point" had he considered his side's second leg against Napoli could be his final match in charge.
There could, however, be little doubt that a Champions League exit at the last-16 stage, following a disappointing domestic campaign, would have seen his position fall under serious threat.
Ex-Real Betis boss Setien was hired as Ernesto Valverde's replacement in January to reintroduce the free-flowing, possession-based brand synonymous with the club, but he failed to inspire his players to a third successive league title, or beyond the Copa del Rey quarter-finals.
Manager Gennaro Gattuso said his Napoli side were "going to have to climb Everest" to progress against Barcelona at the Nou Camp and they appeared up for the challenge, as Mertens delivered an early wake-up call to the hosts.
It took Lenglet's opener to settle Barcelona, for whom once again it was Messi who made the difference when it mattered.
Though there was an element of fortune to the run which preceded his fine finish - the Argentine stumbling between challenges - his commitment to the cause drew the error from Koulibaly which allowed Suarez to put the tie beyond Napoli.
Barcelona have not tasted success in Europe's elite competition since 2015, but progress into the latter stages is a minimum requirement.
A potentially crucial victory for Setien extends Barca's streak of having not failed to qualify for the Champions League quarter-finals since 2007, but as the competition moves to a one-game knockout format in Portugal, his side will be without the comfort of the Nou Camp where they are now unbeaten in their past 36 Champions League home games.
Undoubtedly, Barcelona - and Messi - will need to be at the top of their game to defeat an in-form Bayern.
Reflecting on the defeat, Napoli boss Gattuso said: "We have a lot to regret, we disappeared for half an hour and conceded incredible goals. I am angry we conceded from a set-piece.
"We didn't have enough consistency, even though we started well and could have scored in the opening minutes. My players are strong, but to become even better they need to improve in their attitude.