"It is a huge honour and a dream to sign a contract with FC Barcelona and to work for this fantastic club. They have one of the world's best academies and a good mix of experienced players and young talent," said Flick.
"I have won titles with Bayern Munich, and my hunger for titles is great. I want to stay on that path with Barcelona and I think we can achieve a lot together."
Flick was most recently German national team coach, but was fired last September. His main achievement as a coach is when he led Bayern Munich to the Treble in the 2019/2020 season.
Flick previously had Robert Lewandowski at Bayern Munich as well as Marc-Andr ter Stegen and Ilkay Gndogan with the national team.
AS says he will earn 3m-a-season at Barcelona.
However, the German can earn more in case of success. He will receive a bonus of 1m if the team wins the Champions League and 750,000 for a La Liga title.