Messi's feat came just four days after the four-time World Player of the Year broke Telmo Zarra's 59-year-old record of 251 La Liga goals with a hat-trick in a 5-1 thrashing of Sevilla to take his tally in the Spanish top flight to 253 goals in 289 appearances.
Luis Suarez scored Barcelona's other goal with a brilliant solo effort, which was his first for the Catalans in his fifth appearance.
Elsewhere, Manchester City kept their qualification hopes alive as Sergio Aguero completed a hat-trick in stoppage time to give the English champions a 3-2 win over 10-man Bayern Munich.
Aguero gave the hosts the lead from the penalty spot after centre-back Mehdi Benatia had been dismissed for bringing him down in the box as the last man.
But Bayern still went into the break in front with two goals in the final five minutes of the half, first through Xabi Alonso's free-kick and then as Robert Lewandowski outjumped Vincent Kompany and Bakary Sagna to head home a deep right-wing cross.
City toiled in the second period as the Germans dominated the ball, until Stevan Jovetic cut out Alonso's misplaced pass to send Aguero away to equalise five minutes from the finish.
The Spaniard then popped up a minute into stoppage time to pounce on a mistake by former City defender Jerome Boateng.
It left City level on points with Roma and CSKA Moscow going into the last round of matches, with the English side travelling to the Italian capital and the Russians away in Bavaria.
On a day of records, Roma stalwart Francesco Totti extended his mark as oldest scorer in the Champions League by opening the scoring in his side's 1-1 draw at CSKA.
At 38 years, one month and 29 days, his 43rd-minute goal saw him extend the record he previously set in September to break a three-year-old mark set by former Manchester United winger Ryan Giggs.
But Vasily Berezutsky's equaliser 17 seconds from the end of time-added-on kept the Russians in the race for the knockout stages.
Chelsea romped to a 5-0 win at Schalke 4 to not only secure a place in the second round but also ensure they will win Group G.
Captain John Terry opened the scoring with a header from a corner before Willian finished off a sublime team move with a crisp finish that had even German fans applauding.
Jan Kirchhoff headed past his own goalkeeper before two goals in two second-half minutes from substitutes Didier Drogba and Ramires completed a thoroughly miserable evening for the Germans.
In Group H, Shakhtar Donetsk booked their place in the knockout rounds despite losing 1-0 at home to Athletic Bilbao. That was because Porto, who have won the group, cruised to a 3-0 win at BATE Borisov, who have now let in 22 goals, equalling the record number of goals conceded in the group stages.