Flick signed a three-year contract effective from July 1 to succeed his former boss, who is ending his 15-year tenure after the tournament, the German soccer federation said Tuesday.
The Euro 2020 quarterfinals start July 2, so Flick's team could still be under the control of Löw if Germany gets that far.
Flick's last game in charge of Bayern Munich was on Saturday. He led Bayern to two Bundesliga titles, a Champions League victory and German Cup success.
"The season has just ended and the two years at Bayern Munich still have a strong effect on me. The team spirit and the attitude of the players were outstanding, and I'm taking much with me that will continue to shape my work," said Flick, who informed the Bavarian club in April that he wished to leave.
"I'm really looking forward to it because I can see the quality of the players, especially the young players in Germany. So we have every reason to approach the upcoming tournaments with optimism, for example the European Championship at home 2024."
Flick was Löw's assistant from 2006-14, when they helped Germany win the World Cup in Brazil. He left to become the federation's sporting director through 2017, and then took over at Hoffenheim. He was assistant to Niko Kovač at Bayern but took over the top job, initially on an interim basis, when the Croat was fired in November 2019. Flick then won every title he could win.
"It's a wonderful thing that Hansi Flick is returning to the federation as national team coach," German federation vice president Peter Peters said. "He has developed as a person and as a coach since his already successful time here — not only shown by his fantastic success with FC Bayern."
Flick inherits a team still trying to adjust after an unsuccessful shakeup following Germany's disappointing World Cup in 2018. The team was routed by Spain 6-0 in the Nations League in November. Löw went back on a decision to drop experienced players Thomas Müller and Mats Hummels by recalling them after announcing his intention to cut his tenure short.
Löw's contract was to run through the 2022 World Cup, but instead Flick will guide the team through qualifying for what would be his first major tournament in charge.
Flick's first games will be three World Cup qualifiers in six days against Liechtenstein, Armenia and Iceland in September. Two more follow against Romania and North Macedonia in October, before qualifying ends against Liechtenstein and Armenia in November. Germany is third in Group J after a surprise 2-1 loss at home to North Macedonia. Only the group winner qualifies automatically.
"It all went surprisingly quickly for me with the signature, but I'm very happy to be able to work as the national team coach from autumn onward," said Flick, who wished Löw success at Euro 2020. "Jogi Löw more than deserves a great end to his career as national coach."