Barcelona was out of contract after this year's race and considered one of those most at risk of dropping off the schedule.
The Catalan authorities said in a statement that it had authorised the signing of an extension for 2020 with Formula One.
"The signing will guarantee the celebration of the 30th consecutive edition of this event at the Barcelona-Catalunya circuit," it added.
Germany, which hosted a thriller at Hockenheim last weekend, looks likely to be dropped but Vietnam is set to make its debut with a race in Hanoi and the Netherlands returns for the first time since 1985 to make the most of Max Verstappen's popularity.
Mexico is also out of contract after this year's race and facing a loss of government funding, but Formula One is keen to retain one of its best-attended events.
A new deal for Mexico and extension for Barcelona would stretch the calendar to 22 rounds, providing the new races are ready, but that also needs the approval of the competing teams.
Haas principal Guenther Steiner told reporters at the Hungarian Grand Prix that Formula One had asked about the possibility and he was generally in favour.
The Italian did express concern, however, that smaller teams like his might have to pay more for their engines. The rules currently allow each driver three power units to last the season.
"We need to keep it to three engines. If we introduce a fourth engine, it doesn't make sense financially for us. Actually, it is negative for us so why would we do that?," said Steiner.
"That is down to the engine manufacturers to say yes or no. If they are confident we can do it with three engines, then I'm fine."
Teams have also expressed concern in the past about the toll 22 races would take on their personnel and families, with this year's race calendar already stretching from March through to December.