Pep Guardiola’s side were undone by three moments of inspiration from Messi and a late Neymar goal as well as Claudio Bravo’s ridiculous sending off for deliberate handball.
It was Messi’s 37th hat-trick for Barcelona and it ensured City are now four games without a win.
Sergio Aguero only made the bench, despite returning to action as a substitute against Everton, and didn’t come until it was too late.
And both sides finished with 10 men after Jeremy Mathieu was given two bookings.
It started well for City and they pressed Barca’s make-shift backline well.
But a slip from Fernandinho at a crucial moment allowed Messi to slide beyond Bravo to open the scoring after 17 minutes.
Messi doubled the lead just after the hour mark before nabbing his third in the 69th minute.
Neymar then missed a late penalty on his 150th appearance for Barcelona after Fernandinho brought Messi down in the box before scoring the fourth in the 89th minute.
Bravo was given a straight red for handball after a poor clearance and Mathieu evened the numbers up with a late tackle on Raheem Sterling.
City now have just four points from three games and only lead Germans Borussia Monchengladbach by a point after they beat Celtic in Glasgow.