Barca midfielder Gavi was sent off in stoppage time for a second yellow card as the Catalans clung on desperately to secure victory.
Xavi selected youngster Lamine Yamal on the right wing, making him the youngest starter in Champions League history at 16 years and 83 days.
The teenager showed some bright sparks in the first half but largely Porto were on top, cutting through a Barcelona midfield shorn of the injured Pedri and Frenkie de Jong.
Barcelona holding midfielder Oriol Romeu endured a tough night, with Porto harrying him at every possible moment, roared on by a packed Dragao stadium.
Brought in from Girona to replace Sergio Busquets, the job is proving a big one for the former Southampton and Chelsea man to handle.
He was fortunate to avoid a yellow card in the first half but his team-mates Joao Cancelo, Ronald Araujo and Gavi went into the book — along with coach Xavi.
Mehdi Taremi appealed for a penalty early on after Jules Kounde took a handful of his shirt in the area but it would have been soft.
At the other end Joao Felix was involved in Barcelona’s best attacking moments, to a cacophony of whistles from Porto fans who had not forgotten his Benfica past.
The Eagles beat Porto in the Portuguese Clasico last week, which Felix said would only motivate his old rivals even further.
However Porto midfielder Romario Baro lost concentration just before half-time and it proved costly for his side, who had more than held their own.
Romario’s under-hit pass was easily stolen by Ilkay Gundogan, who threaded through Torres.
The Spanish forward, who replaced injured hitman Robert Lewandowski earlier in the first half, rolled home a low strike under Diogo Costa.
AFP