Ajax 0 Barcelona 2: Messi equals record to ease Barca through
The Argentina star's brace at the Amsterdam Arena took him to 71 goals in the competition - level with Real Madrid legend Raul - to help ensure his side's place in the knockout stages and end Ajax's hopes of qualification.
Having been penned back for large spells by an impressive Ajax early on, Barca took the lead through Messi's clever first-half header.
He took full advantage of sloppy play from goalkeeper Jasper Cillessen to close in on the record and, with Paris Saint-Germain playing their part by earning 1-0 win over APOEL, Messi wrapped up the points and a top-two spot in Group F with a second.
His close-range finish after 76 minutes was enough to end any comeback hopes for Ajax - who had Joel Veltman dismissed five minutes earlier - and draw him level with former Spain international Raul.
Frank de Boer's side will now need to tie up third spot and Europa League participation if their continental journey is to continue into 2015, with all eyes now turning to when Messi will break the record, having also overtaken Cristiano Ronaldo in the process.
Barca thought they had taken the lead after three minutes, but saw Neymar's effort disallowed for offside.
Ajax looked lively on the break and threatened an opener when Lucas Andersen fired wide following a poor clearance from Dani Alves.
The hosts' wingers - Anwar El Ghazi and Lasse Schone – in particular posed problems early on, while Davy Klaassen forced recalled goalkeeper Marc-Andre ter Stegen into a smart stop with his left-footed volley after 26 minutes.
Barca's Jordi Alba was perhaps fortunate to escape punishment when appearing to block El Ghazi's effort with his arm, and the full-back had his side's first shot on target shortly after, but Cillessen was equal to it.
However, Barca took the lead when Cillessen, having kept out Messi's free-kick, raced to the left edge of his area to gather a bouncing ball, only to be beaten to it by the alert Marc Bartra.
The Spaniard picked out Messi and the striker climbed well to head an effort past Ricardo van Rhijn on the line.
Luis Enrique's side looked sharper after the interval and Luis Suarez should have doubled the advantage when one-on-one with Cillessen after a clever pass from Messi.
However, the Uruguayan was superbly denied a first Barca goal against the club he made 159 appearances for during three-and-a-half seasons.
Arkadiusz Milik saw his diving header rebound off Ter Stegen's right-hand post shortly after the hour, but Ajax's comeback hopes were dented when Veltman was shown a second yellow card for bringing Messi down, having previously been booked for a foul on Neymar.
The visitors capitalised on their extra man when Messi moved closer to another piece of history, getting on the end of Pedro's cross from the right as Barca provided the perfect answer to back-to-back La Liga defeats.