The Argentinian striker was at his effortless best, despatching a fine first-half free-kick and then producing two clinical finishes either side of Gerard Pique's header.
Ajax were passengers in the second period and were denied even a consolation when Victor Valdes saved Kolbeinn Sigthorsson's penalty.
Messi, perhaps inspired by Cristiano Ronaldo's treble for Real Madrid on Tuesday night, now has 62 Champions League goals and a record four hat-tricks.
Neymar, making his Champions League debut, was quickly into the action as he raced clear and tested Kenneth Vermeer after only three minutes.
The Brazilian was looking the game's liveliest player, eager for the ball and running at the away defence, but it was Messi who opened the scoring.
He was going away from the box when Lerin Duarte trod on his boot, though he showed no discomfort when stepping up to caress the free-kick home from just outside the area.
The ball crept in via the inside of the post, leaving Vermeer grasping at thin air.
Ajax were vulnerable, ever more so when Niklas Moisander was booked - after a couple of warnings - for tripping Andres Iniesta.
Out of nowhere, Ajax threatened an equaliser in the 31st minute. On-loan Bojan Krkic was the creator against his parent club, neatly making space for himself before curling a teasing cross to the back post.
Ricardo van Rhijn met it with a strong header but Victor Valdes made a good save.
Duarte was next to work the Spain international, striking first time from the edge of the area, and he was again up to scratch.
Valdes' opposite number Vermeer was also helping to keep the score count down, getting down low to save from Neymar and then, seconds before half-time, gathering from Messi who had ignored the run of Cesc Fabregas in favour of shooting.
A couple of minutes earlier Neymar blazed over after taking Iniesta's chipped cross down on his chest.
It took Barca five minutes of the second half to threaten again, Van Rhijn hooking Dani Alves cross away to deny Neymar a simple finish.
That simply delayed the inevitable, though, as a four-on-three breakaway found its way to Messi breaking into the area. He guided the ball on to his left foot, committing his man in process, and finished at the near post.
Messi almost made it three with an improvised touch off his knee, but it was Pique who struck next when he rose to nod home Neymar's precison ball into the box.
Ajax were being cut open at regular intervals and went four behind to Messi's hat-trick goal in the 75th minute.
He made it look simple, feigning to shoot before picking out the bottom corner with apparent ease.
Sigthorsson had the chance to rescue something from the evening when Javier Mascherano conceded the penalty, but Valdes guessed right to preserve his clean sheet.