Mercedes-Benz will be the title sponsor of a race that had been out of contract after this year and had looked in danger of disappearing for financial reasons.
The calendar will have the same races as this season, with the opener in Australia on March 17 and the finale in Abu Dhabi on Dec. 1 -- the latest end to a season since 1963 when it closed on Dec. 28 in South Africa.
Japan's Suzuka circuit has also signed a three-year extension, with owners Honda taking title sponsorship of this year's race there.
Formula One chairman Chase Carey said the agreement with Hockenheim had been reached with the help of Mercedes, the German automobile clubs ADAC and AvD and the country's Minister for Transportation and Digital Infrastructure.
Mercedes' British driver Lewis Hamilton celebrates after winning the German Formula One Grand Prix at the Hockenheim racing circuit on July 22, 2018 in Hockenheim, southern Germany.
Image credit: Getty Images
"This demonstrates how all stakeholders within Formula One are working together to ensure the long-term future of the sport and its fans," he added.
There was no word about the race's future beyond 2019 but Mercedes boss Toto Wolff said it was important for the manufacturer, whose team have been world champions for the past four years.
"This year’s Grand Prix in Hockenheim was a demonstration of the enthusiasm that Formula One generates in Germany," he said.
"It was therefore important for us to do everything in our power to ensure that our home race will take place again next year. Together with Formula One and all the relevant stakeholders, we have found a way to make it happen."
Changes to the 2019 calendar will see Mexico precede the U.S. Grand Prix in Texas and Russia paired with Singapore rather than Japan.
There will also be no repeat of 2018's unprecedented triple-header, a consequence of scheduling to avoid a clash with the World Cup finals in Russia.
March 17 - Australia (Melbourne)
March 31 - Bahrain (Sakhir)
April 14 - China (Shanghai)
April 28 - Azerbaijan (Baku)
May 12 - Spain (Barcelona)
May 26 - Monaco
June 9 - Canada (Montreal)
June 23 - France (Le Castellet)
June 30 - Austria (Spielberg)
July 14 - Britain (Silverstone)
July 28 - Germany (Hockenheim)
Aug. 4 - Hungary (Budapest)
Sept 1 - Belgium (Spa)
Sept 8 - Italy (Monza)
Sept 22 - Singapore
Sept 29 - Russia (Sochi)
Oct. 13 - Japan (Suzuka)
Oct 27 - Mexico (Mexico City)
Nov 3 - United States (Austin)
Nov 17 - Brazil (Sao Paulo)
Dec 1 - Abu Dhabi (Yas Marina)