BRASILIA, Aug 30 (Reuters) - Brazil's Economy Ministry is preparing a new fiscal model to be presented after the October presidential elections, seeking to make the constitutional spending cap more flexible, the Treasury said on Tuesday.

During a news conference on the results of the central government in July, Treasury Secretary Paulo Valle stated that the idea is to put the plan under discussion with authorities, specialists and market agents.

The spending cap currently limits public spending growth to the previous year's inflation, making it challenging to substantially increase social expenditures - a promise made by President Jair Bolsonaro and his leftist rival, former President Luiz Inácio Lula da Silva, who leads voting intentions.

According to David Athayde, a Treasury undersecretary, the spending cap will become "a little more flexible" under the new rule if the country is on a favorable public debt path.

Amid stronger-than-expected public account data, Brazilian public debt stands at 78.2% of GDP, much better than the 100% level that some analysts once calculated due to the pandemic spending spree, but still far from the 60% of GDP average for emerging countries.

In July, Brazil's central government posted a record primary budget surplus, boosted by dividends from state-controlled oil company Petrobras and a significant reduction in expenses.

The 19.309 billion reais surplus was better than the 17.6 billion reais result expected by economists polled by Reuters, and the highest for the month of the nominal Treasury data series started in 1997.

Net revenues had a real gain of 6.3% in July over the same month a year ago, affected by Petrobras dividends of 6.9 billion reais and by a jump in tax revenue.

Spiking commodity prices and a more robust economic activity have made the government record tax revenue from month to month this year.

At the same time, expenses fell by 17.9% in real terms, helped by a significant drop in extraordinary expenditures to battle the pandemic.

The government also posted a 20 billion reais decrease in social security benefits, after an advance payment in July 2021 of the 13th salary to retirees amid the set of actions for COVID-19. That was not repeated this year.

In the 12 months to July, the central government recorded a 115.6 billion reais primary surplus, worth 1.38% of gross domestic product, said the Treasury. ($1 = 5.1161 reais) (Reporting by Marcela Ayres; Editing by Chris Reese and Jonathan Oatis)