A €1bn release clause has also been inserted into the 16-year-old's new deal.
Due to his young age, three years is the maximum Barcelona can give Yamal for now.
Yamal made his debut as a 15-year-old for Barcelona back in April in a La Liga game against Real Betis, becoming the youngest player in history to play in the competition.
This season, Yamal has played nine times for Barcelona, laying on two assists.
Yamal also broke records last month on the international stage when he became Spain's youngest debutant and goalscorer at 16 years and 57 days in a 7-1 win over Georgia.
An official statement from the Spanish champions read: “FC Barcelona and Lamine Yamal have reached an agreement on a new contract binding the player to the club until 30 June 2026, with the buyout clause set at one billion euros.”
Yamal added: "I’m very happy because it’s been a long road in La Masia. It is a source of pride for me.
"It’s a dream for me to spend three more years at the club of my life and I hope I can make the most of my time with Barça.”