According to the monthly fiscal monitor, the improvement came as revenue was up by $1.1 billion or 5.4 per cent, helped by higher personal and corporate income tax revenue.
Meanwhile, program spending was down by $2.9 billion or 12.8 per cent compared with a year ago when the government was hit by costs related to flooding in Alberta.
Public debt charges were down $100 million or 5.4 per cent.
For the first six months of the fiscal year, the federal government posted a deficit of $700 million compared with a deficit of $10.3 billion in the same period a year ago.
The report says the results are in line with the government's fall economic update which forecast a deficit of $2.9 billion for 2014-15.