Messi’s second-half goal in a 3-0 win over Valladolid saw him overtake the mark which the Brazil great had amassed over 19 seasons for Santos.
After the match, Messi posted his thanks to his supporters on Instagram, writing: “When I started playing football I never thought I would break any records.
“And even less the one that I achieved today which belonged to Pele … I can only thank everyone who helped me over the years, my teammates, my family, my friends and everyone who supports me every day.”
Clement Lenglet’s header from a Messi cross had given Barcelona the lead after 21 minutes, with Martin Braithwaite, given a start ahead of Antoine Griezmann, knocking in a second before half-time.
Messi rounded off the scoring after 65 minutes when played in by a neat backheel from Pedri.
The 33-year-old’s future is uncertain given he tried – and failed – to leave Barca last summer, and his current contract runs out at the end of the season.
Barcelona manager Ronald Koeman hailed Messi’s creativity, telling Marca: “I’ve said it a lot, I see Leo happy here.
“He’s very important for us with his creativity. You can see that when there are good players alongside him.”
The team closed out for a first away LaLiga win since the start of October to sit fifth in the table, eight points behind leaders Atletico Madrid, who had earlier won at third-placed Real Sociedad.
Additional reporting by PA.