Substitute Ferran Torres snatched the only goal of the game as Barcelona extended their 100 per cent start in Champions League Group H with a hard-fought 1-0 win in Porto.
The hosts had most of the chances but were undone by a blunder from Romario Baro in first-half injury time which allowed Torres to go through and slide the ball past Diogo Costa.
It was not all plain sailing for the visitors, who had to survive a torrid late spell which culminated in Gavi being sent off in injury time for a second yellow card.
On a history-making night for Barca, Xavi named Lamine Yamal in his line-up, making him the youngest starter in Champions League history at 16 years and 83 days old, beating the previous record held by Celestine Babayaro.
The teenager provided plenty of threat in the visitors’ front line, as did former Benfica star Joao Felix, who was given a tasty reception on his return to Portugal.
Baro should have done better with a Joao Mario cross in the seventh minute but failed to get his shot off in the box, then Pepe’s touch also let him down after being fed by the dangerous Mehdi Taremi.
Barca keeper Marc-Andre Ter Stegen comfortably gathered a tame effort from Stephen Eustaquio and it was not until the 23rd minute that the visitors fashioned a real chance when the ball fell to Felix on the edge of the box but he fired just over.
Robert Lewandowski’s night was ended by an apparent ankle injury on the half-hour mark and he was replaced by Torres, but it was still Porto who threatened with Wendell in particular posing problems down the left flank.
But Baro undid all Porto’s good work on the stroke of half-time, when his blunder allowed Ilkay Gundogan to intercept and he raced clear and fed Torres, who did the rest.
Barca came close to extending their lead early in the first half when Yamal poked a shot on the turn at Costa, then Felix almost sprang onto a Torres through-ball.
But the visitors were grateful to Jules Kounde on 54 minutes after the defender got a foot in to deny what looked like a certain equaliser after Pepe had been sent through on Ter Stegen.
As the game strayed beyond the hour mark, Taremi and Wendell had half-chances for the hosts, who also had a strong penalty claim rejected by VAR after Joao Cancelo appeared to handle in the box.
Porto continued to press and Taremi had the ball in the net in the 83rd from a sublime overhead kick but was ruled clearly offside.
In a torrid final few minutes Gavi was dismissed before Francisco Conceicao twice came close to an elusive equaliser.