Adrien Rabiot had fired PSG into the lead before Cristiano Ronaldo levelled the scores on the stroke of half-time.
PSG had plenty of chances after the break but Ronaldo fired the hosts ahead from the penalty spot on 83 minutes before Marcelo wrapped up the victory.
The French champions can only qualify for the last eight if they win the reverse fixture 2-0 while a 3-1 win would send the tie into extra time.
Don Balon, reported after the game that the Barcelona players were keeping a close eye on the game, and claim that Messi got in touch with his former team-mates, Neymar and Alves after the final whistle.
He reportedly told the pair that PSG are capable of turning the tie around and progressing.
Meanwhile, PSG president Nasser Al-Khelaifi slammed referee Gianluca Rocchi after the defeat. “We can speak about the referee,” he said.
“Two yellow cards, which were not, and an offside against Kylian [Mbappe] that was also incorrect.
“The small things, such as these, can also make the difference against big teams like Real. It was not solely because of this but it helped Real, of course.
“Last year, in Barcelona, the referee. Today, again, the referee. I think that Uefa have to do something.”
Real Madrid defender, Sergio Ramos warned against complacency from his team-mates ahead of the reverse leg.
“We have taken an important step, but the tie is more than open, it’s time to keep working,” he said.
“It is an important victory, these are the days to remember in your career. We must continue in this line in the second leg. We have done a great job. In spite of what they say to Real Madrid, we are not dead.”