The deal, which was agreed before this summer's World Cup, ties the Argentina international to the Nou Camp until June 30, 2018, with the option of a further year on top of that.
Mascherano, whose new contract has a buy-out clause of 100million euros (£80million), joined Barca from Liverpool in 2010 for a reported £18million and has won eight titles, including two Primera Divisions, the Champions League and the Copa del Rey, during his time in Spain.
The versatile 30-year-old midfielder said: "I'm committed to this club until the final day of the contract. I hope I can live up to expectations of the club.
"I'm really happy to be in this great club and be part of a squad with such great players. Let's hope things go really well for us this season. We're looking forward to this season after some difficult times last campaign."