Former Reds striker Luis Suarez, playing against his old club in a competitive game for the first time since he left for Catalonia in 2014, scored his first Champions League goal in over a year to give Barca a half-time advantage.
James Milner was twice denied by Marc-Andre ter Stegen in the second half - while Mohamed Salah was thwarted too - before Messi struck twice in seven minutes to bring up his milestone.
The first goal, a tap-in after Suarez had hit the crossbar, was followed by a brilliant 30-yard free-kick before Salah fired against the post with six minutes remaining as he missed a glorious chance to get a crucial away goal.
Roberto Firmino's ankle injury prevented him from starting and Georginio Wijnaldum was surprisingly deployed in a more advanced role.
The Netherlands international released Sadio Mane to get the wrong side of Gerard Pique in the fifth minute, with the Barcelona defender bumbling the Liverpool forward over in the box, not that referee Bjorn Kuipers was interested in penalty appeals.
Jurgen Klopp was forced to alter his midfield plans again when Naby Keita came off with a suspected groin injury and, two minutes after Jordan Henderson came on as his replacement, one of the new arrival's former team-mates gave Barca the lead and celebrated with gusto.
A raking Arturo Vidal pass found Philippe Coutinho and he shifted the ball onto Jordi Alba, whose driven cross was turned home by a sliding Suarez after he had timed his run between Joel Matip and Virgil van Dijk perfectly.
Liverpool had a chance to hit back 10 minutes before the break when Mane again got behind Barcelona's backline, but the forward lifted his first-time finish over after being found by Henderson.
The Reds had not mustered a shot on target in the first period but they tested Ter Stegen twice in the early stages of the second, though Barcelona's goalkeeper denied Milner and then used a strong right hand to turn Salah's try behind.
Milner could not find a way past Ter Stegen again when he ran onto Salah's pass across the box following Wijnaldum's dummy, yet it was Barca who would strike next with 15 minutes to go.
Suarez turned an effort onto the crossbar with his thigh and the ball came back towards Messi, who chested it down before passing into an empty net.
His 599th goal may have been routine but his 600th was not, a 30-yard free-kick brilliantly whipped into the top-left corner.
Substitute Firmino had an effort turned off the line by Ivan Rakitic and Salah somehow slammed the loose ball against the post as Liverpool sought an away goal – though they were fortunate Ousmane Dembele fluffed his lines with the last kick of the game.
What does it mean? Messi-inspired Barca take huge step towards final
Liverpool were on top for much of the second half, but Messi's late brace – and the Reds' failure to score an away goal – has left Klopp's side facing elimination already. Perhaps that was why the German was so keen to try and get something to take back to Anfield.
Magical Messi delivers again
There are not enough superlatives to describe Messi's brilliance. For 75 minutes he was, by his own ridiculous standards, largely subdued, but all that will be forgotten about thanks to his two goals. His 48th goal from a direct free-kick was inch-perfect and brought up 600 for the club, 14 years on for his first for Barca.
Coutinho a non-factor against former employers
While Suarez reminded Liverpool fans of what they once had, Coutinho was unable to deliver the type of performance that earned him a move from Anfield to Camp Nou. As has often been the case in his first full season in Catalonia, the contest passed him by and Ernesto Valverde's patience wore thin by the hour mark when Coutinho was the first player substituted.
Having already been confirmed as LaLiga champions, Barcelona could rest players at Celta Vigo on Saturday prior to their visit to Anfield three days later. Liverpool, one point behind Premier League leaders Manchester City, do not have such a luxury and will likely be at full strength when they visit Newcastle United.