The Argentina international agreed a new deal with the Catalan giants before he travelled to play for his nation at the World Cup in Brazil earlier this summer.
"FC Barcelona have announced that Javier Mascherano will sign an improved and extended contract on Tuesday August 26 that will see him stay at the club until June 30, 2018," a statement on Barca's official website read.
"This extension was agreed and announced just before the start of the World Cup in Brazil, where Mascherano was playing for Argentina. The new contract includes a buyout clause set at 100 million euros."
Barcelona also confirmed that Mascherano had returned to training after an extended break following Argentina's appearance in the World Cup final, which they lost to Germany, and will feature in the Joan Gamper Trophy against Mexican side Club Leon on Monday.
Mascherano has played 184 matches for Barcelona - where he has been deployed as a defender and a midfielder - since signing from Liverpool in August 2010.
Despite having cemented his place in the first team, though, Mascherano's contract situation saw him linked with a return to his former side Liverpool earlier this year, as well as Napoli