Robert Lewandowski's withdrawal due to an ankle injury led to Torres entering the field in the 34th minute, and the Spaniard found the back of the net shortly before the interval in Portugal.
The result has seen Barcelona, who had Gavi sent off late on, take firm control of Group H with six points, while Porto remain second in the section on three points, ahead of third-placed Shakhtar Donetsk on goal difference.
Barcelona's Lamine Yamal became the youngest-ever player to start a game in the Champions League at the age of 16 years and 83 days old, breaking Celestine Babayaro's record from November 1994.
The first half-chance of the match fell to the visitors in the sixth minute, but Joao Felix's effort after smart work from Ilkay Gundogan was just wide of the post.
Barcelona goalkeeper Marc-Andre ter Stegen was then forced into action in the 17th minute to keep out a strike from Stephen Eustaquio, who had been found by Galeno.
Felix was again involved in a good moment for the visitors in the 23rd minute, with the on-loan Atletico Madrid forward bringing a smart save from Porto goalkeeper Diogo Costa with a powerful drive.
Barcelona lost Lewandowski to an ankle injury late in the first period, with Torres entering as his replacement.
Both sides had chances to score towards the end of the first period, with Mehdi Taremi being denied by Ter Stegen, before Costa kept out Torres's strike down the other end of the field.
Barcelona did manage to make the breakthrough moments before the interval, though, with Torres collecting a pass from Gundogan before finding the back of the net with a cool finish.
Porto looked to answer back less than a minute after the restart, but Joao Mario's strike from distance just served wide of the top corner.
The home side's next chance came for Brazilian forward Pepe, but he was denied by a brilliant last-ditch challenge by recovering defender Jules Kounde.
Pepe then clipped a header wide of the post from a Romario Baro cross just past the hour during a strong period for the Portuguese outfit, who were much improved under the interval.
Ter Stegen was then twice called into action to deny Wendell and Taremi, before the Barcelona goalkeeper made a standout stop to keep out a curling Galeno effort in the 71st minute.
Porto were awarded a penalty in the 77th minute for a Joao Cancelo handball, but the referee was sent across to the monitor before overturning the decision, with Barcelona actually given a free kick due to a Eustaquio handball just before the Cancelo incident.
The hosts then had the ball in the back of the net through Taremi, but the offside flag rightly denied the experienced striker.
Barcelona had Gavi sent off in the final exchanges for a second bookable offence, but the Catalan outfit managed to resist the late pressure to claim an impressive three points on their travels.
Xavi's side will now switch their attention back to La Liga, preparing to travel to Granada on Sunday, while Porto will be in Primeira Liga action against Portimonense on the same night.