(Adds detail, comment)
By Jamie McGeever
BRASILIA, June 28 (Reuters) - Brazil's public finances swung back into the red in May with the primary deficit widening sharply from the same month last year, the central bank said on Friday, although overall national debt as a share of the economy fell unexpectedly.
The Brazilian government posted a primary fiscal deficit of 13.0 billion reais ($3.39 billion) in May, slightly less than the 14.0 billion reais deficit economists had expected but much wider than the 8.2 billion reais deficit in May last year.
The primary budget balance, which comprises the central government, regional governments and state-owned enterprises before interest payments are factored in, is a key measure of Brazil's fiscal health.
"The public debt dynamics remain a source of concern," Alberto Ramos, head of Latin American research at Goldman Sachs, wrote in a client note.
"The fiscal picture remains very weak, despite the effort over the last 3 years to contain discretionary spending and the significant retrenchment of public investment," he said.
The government is trying to push through Congress an ambitious social security system reform bill, which aims to shore up the public finances and save over 1 trillion reais ($262 billion) over the next decade.
The accumulated primary deficit over the 12 months to May was 100.36 billion reais, or 1.44% of GDP, up from 1.38% in April, the central bank said on Friday. The end-2019 target is for a deficit of around 139 billion reais or 1.9% of GDP.
Including interest payments, Brazil's nominal public sector deficit was 47.6 billion reais in May and 484.7 billion reais in the 12 months to May, or almost 7% of GDP, the central bank said.
Brazil's gross debt as a share of GDP fell to 78.7% from a record 79.0% in April, but net public sector debt rose to 54.7% of GDP from 54.4% the month before and 54.1% at the end of last year, the central bank said.
($1 = 3.83 reais) (Reporting by Jamie McGeever Editing by Chizu Nomiyama and Susan Thomas)