The city said the contract was signed Friday with representatives of auto racing's world governing body FIA and race promoters. It said the deal can be extended for another five years.
Sao Paulo's contract with F1 was set to end this year.
Although Interlagos is a popular track for drivers, teams had been complaining that it was too outdated.
Officials said more than $70 million will be spent to fully renovate the track before next year's Brazilian GP. This year's race is Nov. 9.
Among the requests made by F1 officials is an entirely new area for the pits and paddock. The circuit will also be entirely repaved.