With five minutes left Messi produced a typical run outside of the Atletico penalty area, played a one-two with Luis Suarez and curled the ball past Jan Oblak for the only goal of a thrilling game.
It rained all day in Madrid before kickoff and it rained heavily for all 90 minutes in the Wanda Metropolitano Stadium, but far from spoiling the show the rain only added to the spectacle on a lightning fast pitch on which both teams gave everything.
With Hector Herrera outstanding in the middle of the park Atletico took the game to Barca and for half an hour the reigning Champions were on the back foot, unable to move the ball comfortably out of their half and thankful to Marc Andre Ter Stegen, who made two reflect saves to deny headers from Mario Hermoso and Alvaro Morata.
As the home side tired Barca came into things more and Gerard Pique was unlucky to see his header from a corner bounce off the pitch and onto the crossbar.
The second half began with Atletico willing to sit deeper in their own half and invite Barca onto them and Oblak made a comfortable save from Suarez before Leo Messi's goal-bound shot was deflected wide off a defender.
Messi showed flashes of his genius, but the Atletico defense were able to double up on him most of the time, while Antoine Griezmann struggled to get involved on his return to the Wanda and was booed by his former fans every time he touched the ball.
Vitolo replaced Joao Felix for Atletico, while Artur Vidal came on for Arthur Melo for the visitors as both coaches looked for a way to end the deadlock.
Atletico went close after a wild scramble in the Barca area but were unable to get the ball through a wall of bodies, before referee Mateo Lahoz angered the Atletico fans by not showing Pique a second yellow card for a late challenge on Morata.
The Barca defender then had to leave the pitch after a bad challenge from Vitolo and it looked as if the game was heading for a draw but with Messi on the pitch you can never say the game is over.