Brazilian winger Pepe sent Porto ahead but Barcelona’s Portuguese duo Joao Cancelo and Joao Felix both netted to turn the game on its head.
The former Benfica pair pounced against their old club’s rivals to ensure Xavi Hernandez’s team would not face a humiliating group stage exit as they did in both of the last two seasons.
Defeat by Shakhtar Donetsk in Hamburg in their previous European match made Barca nervous, with poor performances domestically adding to their jitters.
However despite conceding first, Cancelo quickly levelled and he set up Felix in the second half for the winner.
Xavi shook up his side with Cancelo switching to left-back and Oriol Romeu dropped for Ilkay Gundogan after Barcelona’s 1-1 draw at Rayo Vallecano on Saturday, the latest in a string of sub-par displays.
Inaki Pena kept his place in goal for the Catalans while first choice Marc-Andre ter Stegen is out with back pain and made several saves as both sides racked up good chances.
Porto’s Pepe, whistled by Barca fans because of his Real Madrid past, became the fifth oldest player in Champions League history at 40 years and 275 days.
The veteran Portuguese centre-back was in the right place at the right time to block Felix’s early effort, after Raphinha tested Diogo Costa with a low drive.
Porto’s Medhi Taremi beat Pena after 25 minutes but the goal was ruled out for offside against the Iranian striker.
The goalkeeper made a solid save to deny Galeno after he burst into life and squeezed a shot off, with pressure mounting on the Spanish champions.
Porto made the breakthrough after 30 minutes, with Brazilian winger Pepe slamming home the rebound after Pena denied Evanilson.
Before Barcelona allowed fear to set in, Cancelo dragged them back level with a fine individual goal.
The former Benfica defender, on loan from Manchester City, cut in from the left to bypass a defender and beat Costa with a confident strike.
Raphinha flashed a shot tantalisingly wide when Costa gave the ball away on the edge of his own box to Pedri, and Pena thwarted Alan Varela at the other end as the game lurched from one side to the other.
The second half began at the same frantic pace, with Felix cracking a strike off the top of the crossbar.
Ten minutes later the 24-year-old had his goal, exchanging passes with the rampaging Cancelo and carefully slotting home, his first for Barcelona since mid-September.
Raphinha came close twice in quick succession as the Catalans sought to stretch their lead, but although they could not, this time around they still managed to get the job done.
Barca defender Ronald Araujo’s huge fist pump at full-time showed it was with more nerves than it should have been.
AFP