The 33-year-old had one year left on his contract with the German champions but in May said: “My story with Bayern is over.”.
He has joined his new team-mates in Miami as part of Barcelona’s four-match tour in the United States.
“I’m finally here. I’m delighted to be at Barca,” Lewandowski said.
“The last few days have been very long, but the deal is done and now I can focus on a new chapter and challenge in my life.
“I’ve always wanted to play in La Liga and for the big clubs.
“I’m here to help Barca get back to the top and win as many titles as possible.”
Lewandowski, who had a buyout clause of 500m euros (£425.9m), joined Bayern on a free transfer in 2014 after his departure from Borussia Dortmund.
He scored 50 goals in 46 games last season as he helped Bayern win a 10th straight Bundesliga title.
Lewandowski has scored 344 times in 374 games for the club and is their second-highest scorer of all time behind Gerd Muller.
He has won the league in all eight of his seasons at Bayern and also won the Champions League in 2019-20.
Lewandowski is Barcelona’s fourth signing of the summer following Brazil winger Raphinha joining from Leeds United in a deal worth up to £55m, while Ivory Coast midfielder Franck Kessie and Denmark defender Andreas Christensen have arrived on free transfers after their respective contracts with AC Milan and Chelsea came to an end.
France winger Ousmane Dembele has also signed a contract extension with Barcelona this summer.
Meanwhile, Bayern have signed the Netherlands defender Matthijs de Ligt from Juventus on a five-year contract in a deal worth 77m euros (£65.6m). (Courtesy BBC)