The midfielder will head to the Catalan club from Juventus at the end of the current season with the move costing more than $67m (60m euros).
The 30-year-old has signed a four-year deal with the reigning La Liga champion after a successful stint in the Italian Serie A.
He helped Juventus win three league titles in his four years at the club and looks set to add another this season with the team four points clear at the top of the table.
His move to Spain comes after a turbulent season for Barcelona — which sits just two points behind fierce rival Real Madrid in the league, with six fixtures remaining.
“I am very happy, I will give my all for this club. See you soon,” Pjanić wrote on Instagram.
Contracts for veteran duo
The Bosnian international’s move will see Barcelona’s Arthur head in the other direction, with Juventus paying an initial $80 million for the Brazilian.
Arthur joined Barcelona from Brazilian club Grêmio in 2018, winning the league title and Super Cup in his debut season.
Like Pjanić, the 23-year-old will not move to his new club until the end of the current season.
Juventus has also agreed a year-long contract extension for both 35-year-old captain Giorgio Chiellini and 42-year-old goalkeeper Gianluigi Buffon.
“Super Gigi is proof that age is only a number,” read a statement from the club.
The veteran keeper has played more than 500 times for Juventus since his debut in 2001 and returned to the Italian outfit last year after a stint with French champion PSG.