The Argentina international scored his eighth and ninth goals in the group stage to seal his side’s progress to the next round of the competition.
Lionel Messi scored twice as Barcelona won 2-0 at Celtic to seal qualification for the Champions League last 16 as Group C winners.
Barca’s victory in Glasgow – coupled with Manchester City’s draw against Borussia Monchengladbach – means they cannot be caught with a game still to play.
The visitors made five changes after their poor draw against Malaga last time out, with Messi returning from illness and strike partner Luis Suarez back following suspension.
And those alterations from Luis Enrique were rewarded, with Messi opening the scoring with a volley midway through the first half and sealing victory with a second-half penalty after Suarez had been fouled by Emilio Izaguirre.
It was a much-needed result for Barca, who romped the reverse fixture 7-0 at Camp Nou but had only secured wins in two of their previous five games in all competitions.
Celtic were more competitive this time around, but are now guaranteed to finish bottom and their European hopes are over for 2016-17. They sit three points adrift of Gladbach and have a worse head-to-head record.
Messi, who now has nine goals in this season’s competition, fired an early effort wide and came close to turning in Ivan Rakitic’s bouncing header, but the Argentina international was not to be denied after 24 minutes.
Neymar picked out Messi with a clever chip from the left-hand channel and he took the pass in his stride to send a first-time volley past Craig Gordon at his near post, the visitors’ 400th goal in all competitions under the management of Luis Enrique.
Celtic responded positively, with Moussa Dembele’s powerful shot forcing Marc-Andre ter Stegen into action.
However, the hosts needed Gordon to ensure they went into the break with only a one-goal deficit, the goalkeeper making a magnificent one-handed save to keep out Suarez’s header after Messi stood up a cross.
Celtic started the second half strongly as Callum McGregor’s shot was pushed away by Ter Stegen, before Brendan Rodgers’ men missed a golden chance to equalise.
Dembele was in prime position to score when he sent a weak header straight at Ter Stegen from six yards after a cross from James Forrest, who had replaced Scott Sinclair at the break.
That miss proved costly with Barca doubling their lead in the 55th minute. Sergi Roberto’s throughball led to Suarez being brought down by Izaguirre in the penalty area and Messi stepped up to send the spot-kick straight down the middle.
Messi scored a hat-trick in the Camp Nou meeting and could have repeated the trick here, only to drag a right-footed shot wide in a presentable chance after Neymar’s pass.
An angry Neymar went head-to-head with Mikael Lustig after a challenge late in the game, with both players booked for the exchange.
That means he is out of Barca’s last group game against Gladbach through suspension, but Wednesday’s results mean there is little meaning to that fixture.
The match had become more straightforward for Barca as Celtic ran out of steam late on and Suarez almost put the icing on the cake when his shot hit the post from close-range after Messi had impressively created the opportunity.