(Recast, adds more data and context)
BRASILIA, Nov 26 (Reuters) - Brazil's central government posted its first primary budget surplus in six months in October, but the administration still risks recording its first annual deficit in nearly two decades.
The central government, which includes results from federal ministries, the central bank and social security, had a primary budget surplus of 4.101 billion reais ($1.63 billion) in October, the country's National Treasury said on Wednesday.
The central government had posted monthly deficits since May of this year, including September's a primary deficit of 20.399 billion reais.
The primary budget balance excludes interest payments, and as such, it is a gauge of a capacity to service debt.
The rapid deterioration of the fiscal accounts that has worried investors and rating agencies alike is one main problems the administration's new economic will face in a second term of President Dilma Rousseff that starts on New Year's day.
Rousseff's pick for the finance ministry, Joaquim Levy, is a fiscal conservative who is expected to cut expenditures and put in place multi-year fiscal goals to recover the public finances.
Levy and other members of the economic team are expected to be officially named on Thursday, but it is not yet known when will they take over the posts.
So far this year, the central government has accumulated a primary deficit of 11.577 billion reais. The central government original target for the year was for a surplus of 80.773 billion reais.
The central bank is scheduled to release on Friday the country's consolidated fiscal results of the public sector, which adds in states and municipalities and some state-owned companies. It is regarded as the benchmark for Brazil's fiscal performance.
The government initially set a consolidated primary surplus target of 116 billion reais or 2.15 of its gross domestic products at the start of the year. It then lowered the target to 1.9 percent of GDP and is now seeking congressional approval to cut that goal to just 0.19 percent of GDP.
Ratings agencies have warned that the deterioration of the fiscal accounts combined with lack of transparency could lead the country to suffer another debt downgrade. ($1 = 2.5101 Brazilian real) (Reporting by Luciana Otoni; Writing by Alonso Soto; Editing by Chizu Nomiyama and W Simon)