Officers said Aparecida Schunck was freed from two men on the outskirts of the city.
Police told the BBC that the two men were arrested after a major operation to secure her release.
A ransom of $36.5m (£28m) had been demanded by the kidnappers, according to the magazine Veja. But police said no ransom was paid.
According to the authorities, Schunck was not harmed in the operation conducted by São Paulo’s anti-kidnapping division.
Schunck is the mother of Fabiana Flosi, who married Ecclestone in 2012.
São Paulo, Brazil’s largest city and the centre of commerce, for decades has had problems with people being kidnapped and held for ransom, but a dedicated police task force has reduced the crime drastically over the past 15 years.
The incident came just ahead of the Olympic Games in Rio de Janeiro. Authorities say they will be deploying 85,000 troops and soldiers during the competition, which starts on 5 August.