The new deal signed by the 16-year-old includes a one billion euro release clause (£865.6 million), similar to those put in place in recent times for the club's other young stars Gavi and Pedri.
Ansu Fati, who is currently on loan at Brighton, also has a matching clause in his contract.
Yamal became Barcelona's youngest debutant at 15 years and 290 days old against Real Betis in April last season.
This season he went on to become La Liga's youngest starter in the 21st century, and also the youngest assist provider in the same time frame.
Yamal has not scored for Barcelona yet but if he does this season, he can overtake Fati's club record - or the overall record for youngest La Liga scorer, set by Malaga's Fabrice Olinga at 16 years and 98 days old.
Last month he also became Spain's youngest-ever player and goalscorer as La Roja thrashed Georgia 7-1 in a Euro 2024 qualifier.