The ministry said the public sector budget deficit fell to 5.520 billion euros ($7.4 billion)in the January to July period.
That was lower than a deficit of 6.006 billion euros in the same period last year, when stripping out extraordinary income from banks' pension funds which were transferred to the state in 2012.
Last year's budget deficit from June to July was 3.424 billion euros when the extraordinary income was included.
Portugal has been in its worst recession since the 1970s as it enacted harsh austerity under a bailout but it registered its first positive growth in two and a half years in the second quarter.
The finance ministry the improvement in the accounts was thanks to a rise of 21.4 percent in direct taxes. Income from indirect taxes, such as value-added tax, fell 1.9 percent.
The central administration's spending rose 3.5 percent in the period compared with last year, boosted by social security benefits.