Barcelona beat Sevilla 2-1 in the Spanish Super Cup as Messi overtook Andres Iniesta, who had 32 titles when he left this summer for the Japanese league as the most successful Catalan player in history.
Ousmane Dembele scored a late winning goal with a blistering strike from outside the area.
Pablo Sarabia opened for Sevilla in the ninth, when the video assistant referee overruled an offside call in the first use of VAR in Spanish competition.
Gerard Pique equalized three minutes before halftime when he finished off a free kick by Messi that hit the post and ricocheted off the back of goalkeeper Tomas Vaclik – and again off the upright – before falling to the Barcelona defender. Barcelona goalkeeper Marc-Andre ter Stegen was the hero of the day when he saved an 89 minute penalty from Yedder to secure the 2-1 win