"The long period of uncertainty over the site of the pinnacle of motorsport in Germany is ended," the state-owned Nuerburgring operating company said on Thursday in a statement.
The Rhein-Zeitung newspaper reported that Ecclestone struck the deal with Nuerburgring GmbH chief Karl-Josef Schmidt late Wednesday.
"I very much appreciate the Nuerburgring and its history," Ecclestone said in translated comments. "Even today, the grand prix route demands the most from drivers and teams."
Hockenheim, which hosts the German Grand Prix every other year, indicated its availability to host the July 7 race if a deal could not be struck with Nuerburgring.
"The Nuerburgring is a household name and very important for all of us," three-time world champion Sebastian Vettel told the dpa news agency. "Everything that goes along with it is an experience. It shouldn't be allowed die out. I'm delighted the grand prix is secured."
It is still unclear if the race will be called the German Grand Prix or European Grand Prix.
Nuerburgring GmbH insolvency administrator Thomas B. Schmidt thanked Ecclestone and said "with his commitment to the legendary racetrack, he delivers a significant and valuable contribution to the Nuerburgring."
Nuerburgring filed for insolvency last July. F1 has been racing on the track since the 1950s.