Claudio Bravo and Jeremy Mathieu saw red in the second period as both teams finished with 10 men, but a treble from Messi and late strike from Neymar, who also missed a penalty, ensured that it was a miserable return to Barcelona for Man City boss Guardiola.
Messi was back in the Barcelona XI after making his return from a groin problem off the bench at the weekend, while Andres Iniesta and Samuel Umtiti were also recalled in a team that showed four changes from their league game with Deportivo La Coruna on Saturday afternoon.
The big team news came from Man City though as Sergio Aguero was left on the bench in a surprise tactical call from Guardiola, which meant a striking role for Kevin De Bruyne, with Nolito, Raheem Sterling and David Silva in support of the Belgian international.
It was a positive start from the visitors, who enjoyed plenty of possession inside the opening 10 minutes of action. Barcelona, on the other hand, were forced into a defensive change early on when Lucas Digne took the place of Jordi Alba, who appeared to aggravate a previous hamstring problem.
The home supporters did not have much to shout about in the opening 15 minutes, but their team took the lead in the 17th minute of action when Messi took advantage of a unfortunate slip from Fernandinho inside the Man City box before moving the ball past Bravo and sliding home from close range.
It was an opening 30 minutes that produced very few clear-cut chances, but Barcelona had two opportunities in quick succession in the 32nd minute - Neymar first being denied by former teammate Bravo, before Ivan Rakitic headed a delicious Messi free kick wide of the post from close range.
Man City struggled in the final third for much of the first period, but Nolito did force a smart save from Marc-Andre ter Stegen in the 38th minute, before the German goalkeeper kept out Ilkay Gundogan with a reaction stop moments later.
Barcelona might have led by Messi's strike at the interval, but it came at a cost as the home side were forced into another defensive change late in the first period - Gerard Pique needing to be replaced by Mathieu after failing to recover from a late challenge from Silva.
Both teams had opportunities to add to the scoring in the final moments of the first half, but John Stones headed a Silva free kick just wide of the post, before Luis Suarez was denied by a double save from Bravo down the other end of the field.
Man City started the second period on the front foot and false nine De Bruyne stung the palms of Ter Stegen with a decent effort as the home side showed more signs of problems at the back.
It all came crashing down for the away side in the 53rd minute, however, when Bravo, on his return to Barcelona, received a straight red card after handling a Suarez effort outside of the penalty box, having cleared straight into the striker's path in what was a poor mistake from the Chilean international.
Two Man City changes followed as Nolito was replaced by second-choice goalkeeper Wilfredo Caballero, while Gael Clichy took the place of Pablo Zabaleta, who did not recover following a strong challenge from Digne.
It got worse for Guardiola's side in the 61st minute when Barcelona scored a second and it was once again Messi that did the damage, finding the bottom corner with a well-placed strike after Iniesta had regained possession just outside the Man City box.
De Bruyne remained the player most likely to make things happen for Man City and the Belgian brought a smart save from Ter Stegen 25 minutes from time, but Messi had his third in the 69th minute when Suarez made use of some more sloppy defending before feeding the Argentine, who tapped home from inside the box.
Barcelona were also reduced to 10 men in the 73rd minute, however, when Mathieu picked up two bookings in the space of two minutes - the second of which came after a lunge on Sterling.
Eventually Aguero was introduced for the visitors 10 minutes from time, but it was Barcelona that looked the more likely to add to the scoring and they had the chance to make it 4-0 from the penalty spot late on when Aleksandar Kolorov brought Messi to the deck with a poor challenge.
It was Neymar that stepped up to take the penalty, only to be denied by Caballero. The Brazilian did eventually have his goal in the 89th minute, however, after combining with Messi and finishing into the back of the net from close range.
Next up for Barcelona is a trip to Valencia in La Liga on Saturday, while Man City will attempt to return to winning ways in the Premier League when they host in-form Southampton on Sunday afternoon.