Julian Nagelsmann extends contract as Germany head coach until 2026
"This is a decision from the heart. It is a great honour to coach the national team," Nagelsmann said in a statement.
The announcement comes just a few weeks before Germany is set to host the 2024 European championships in June and July.
Nagelsmann said he had been "moved by the enthusiasm of the fans" after victories in the recent friendlies against France and the Netherlands.
"Together, we now want to have a successful home Euros," Nagelsmann said.
The DFB was already "absolutely convinced" of the need to keep Nagelsmann beyond this year's tournament, national team director Rudi Voller said in the statement.
The manager's decision to extend his stay to the 2026 World Cup in North America sent a "strong signal", DFB president Bernd Neuendorf said in the statement.
The announcement puts to bed speculation that Nagelsmann would return to club football after Euro 2024.
The coach was "on the wish list" for a lot of top clubs in Europe, Neuendorf said.
Nagelsmann was strongly linked with a return to Bayern Munich, who parted ways with the native Bavarian last year.
The perennial winners have, however, struggled since dumping Nagelsmann, surrendering their Bundesliga crown to Bayer Leverkusen this season and ending a streak of 11 straight titles.
Despite remaining in the hunt for the Champions League, Bayern's poor league form was enough to cost Nagelsmann's replacement Thomas Tuchel his job.
Nagelsmann, who initially only signed a contract with the national team through to the end of this summer's tournament, will not however be the one to replace Tuchel.
Germany will be looking to compete at Euro 2024 after being dumped out of the 2022 World Cup in Qatar at the group stage.
A miserable run of results following the tournament was enough for DFB management to decide they could not continue with coach Hansi Flick.
Germany's fortunes have since picked up with Nagelsmann at the helm, and the team will head into the championships in good form.
The tournament kicks off in Munich on June 14th, when Germany face Scotland at Bayern's Allianz Arena.