"FC Barcelona and Liverpool FC have reached agreement in principle for the transfer of Javier Mascherano, who will join the club for the next four seasons," Barca said in a statement on their website.
"The agreement was reached after considerable effort from the club over the last few hours and the willingness and desire of the player to make the move."
Liverpool manager Roy Hodgson was eager to keep hold of influential midfielder Mascherano but the Argentinean international jumped at the chance to join a host of stars at Barcelona.
He will fill the void left by the departure of Ivorian midfielder Yaya Toure, who moved to Manchester City.
"Mascherano is a great player. Very strong in his position and a player who wins a lot of possession," Barcelona winger Pedro said.
"He'll be a good addition to the squad."