Palmeiras announced the agreement with Barcelona on Thursday to transfer their central defender Yerry Mina through an official statement.
Mina will sign a contract that contains a 100-million-euro termination clause, the Barcelona FC said in a communiqué.
The board asked Mascherano to stay at the club until Yerry Mina arrived. He continued in this position following his move to Independiente de Santa Fe, where he established himself as one of South America's most promising players in the position before securing a move to Palmeiras in 2016.
Mascherano has started only six La Liga games so far this season, with Thomas Vermaelen typically selected by Valverde as Gerard Pique's partner in the absence of the injured Samuel Umtiti. He often makes runs forward and is unsafe in the box thanks to his vertical reach.
The only other Colombian player to wear Barcelona's jersey was forward Lauro Gonzalo Mosquera, but his only appearance came in a friendly in 1964.
Mina is set to play in his first World Cup in Russian Federation this year.
Barca are running away with La Liga and already lead by nine points. The teams drew 1-1 in the first leg last week in Vigo.