The Argentina international has agreed to an improved four-year deal at Camp Nou which includes a buyout clause of €100 million
The Argentina international had been the subject of transfer speculation in recent weeks, with Napoli confirming they were keen on securing a deal for the player, who turns 30 on Sunday.
However, Mascherano has now brought talk of a Camp Nou exit to an end by agreeing terms over an improved contract, which will keep him at the club until June 2018 and included a buyout clause of €100 million.
"FC Barcelona announces that it has reached an agreement with Javier Mascherano for the improvement and extension of his contract for the next four years, until 30 June 2018, plus an optional season. His buyout clause will be €100m," a statement released on the club's official website confirmed.
Mascherano, who joined Barcelona from 2010 in Liverpool, has made 184 appearances for the Blaugrana, including 44 in the 2013-14 campaign.
The Argentine, who is currently preparing for the World Cup finals, has won eight major honours with the Catalans, including two Liga titles and the 2011 Champions League.
Speculation had mounted that Mascherano could be offloaded this summer as part of the rebuilding work under new head coach Luis Enrique, who replaced Gerardo Martino at the end of the season.
Reports in Spain suggest Mascherano could be moved back into a midfield role under Luis Enrique next season, having been converted to a central defender by Pep Guardiola and used predominantly in that role by both Tito Vilanova and Martino.