The Catalonian club announced the acquisition on Thursday.
He will be Barcelona's second signing of the January transfer window after Philippe Coutinho's 160 million-euro capture from English topflight, Liverpool.
Barça already had an option to sign Mina in summer for a fixed price of €9m, but an agreement to bring that forward by several months has always been expected.
The Colombia global will strengthen Barcelona's defensive options as Javier Mascherano is expected to leave Camp Nou in the January transfer window, with Chinese Super League side Hebei China Fortune reportedly keen on the experienced Argentine.
Mina made 33 appearances for Palmeiras over the last two seasons, helping them win the league title in 2016.
Barcelona also officiated the signing of the first Colombian player in the history of Barcelona.
"FC Barcelona and Palmeiras have reached an agreement for the transfer of the player Yerry Mina for the remainder of the season and five more until June 30, 2023", FC Barcelona said in a news release.
It is also reported that the termination clause of the Colombian defender's contract will be €100 million.
Veteran Mascherano is disgruntled at his lack of minutes, as he hopes to earn a place at the World Cup for Argentina, and so is eyeing a move to China, with Hebei Fortune favourites.