Brazil soccer great Pele has paid tribute to Lionel Messi for equalling his goal-scoring record for a single club after the Argentine forward netted his 643rd goal for Barcelona in Saturday's 2-2 home draw with Valencia.

Messi, 33, hit the milestone goal with a diving header just before halftime immediately after his penalty was saved by Valencia keeper Jaume Domenech.

Messi, who made his first appearance for Barcelona aged 17 in 2004, needed 748 matches to score 643 goals, while Pele managed the tally in 665 competitive games for Santos.

"When your heart overflows with love, it is difficult to change your path. Like you, I know what it's like to love wearing the same shirt every day," Pele, the only player to win the World Cup three times, wrote on Instagram.

"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."

Pele, now 80, made his Santos debut aged 15 in 1956 and left in 1974 after winning six Brazilian league titles plus two Copa Libertadores crowns, South America's equivalent of the Champions League.