Messi scored his 643rd goal for Barca during Saturday's 2-2 draw at home to Valencia in LaLiga.
The six-time Ballon d'Or winner matched Pele's haul of 643 goals in just 656 matches for Santos between 1956 and 1974.
Messi ties Pelé after reaching 643 goals for a single club 🙌 pic.twitter.com/QWmJwS7Doa— beIN SPORTS USA (@beINSPORTSUSA) December 19, 2020
Pele, regarded by many as the best to ever play the game, posted a tribute to Messi on Instagram.
"When your heart overflows with love, it is difficult to change your path," the Brazil great wrote.
"Like you, I know what it's like to love wearing the same shirt every day. Like you, I know that there is nothing better than the place we feel at home.
"Congratulations on your historic record, Lionel. But above all, congratulations on your beautiful career at Barcelona. Stories like ours, of loving the same club for so long, unfortunately will be increasingly rare in football.
"I admire you very much, @leomessi."
Having initially seen a penalty saved by Jaume Domenech, Messi got his milestone goal when he met a cross from the left and nodded home from point-blank range.
Messi's headed goal was his first for Barcelona in all competitions since March 2017, while he missed a spot-kick for the club for the first time since February last year.
Remarkably, his latest goal was also his 450th in LaLiga, making him the first player to reach that figure for a single club in any of Europe's top five leagues.