OTTAWA -- The federal government's fiscal surplus crept higher in July as rising tax revenue grew at a faster pace than spending.

Ottawa's surplus after four months of the 2015-16 financial year was $5.16 billion -- including July's $150 million surplus.

That compares with a deficit of $807 million through the April-to-July period last year, which included a $1.23-billion deficit for July 2014.

According to the Finance Department's monthly fiscal monitor, revenue in July increased by $2.12 billion, or nearly 10 per cent, compared with last year. The report cited higher revenue from corporate income tax and the goods and services tax.

Spending on federal programs in July increased by $858 million, or about four per cent, compared with a year earlier, boosted in large part by the increase and expansion of the universal child-care benefit.

Public debt charges fell by $119 million, or nearly five per cent, due to lower interest rates.

The government's spring budget projected a surplus of $1.4 billion for the 2015-16 fiscal year, which ends next March.

The July figures come in the heat of the federal election campaign that's seen the party leaders try to position themselves as best for the economy.

Both Conservative Leader Stephen Harper and NDP Leader Tom Mulcair have promised balanced budgets, however Liberal Leader Justin Trudeau has said he will run deficits to fund infrastructure spending.

Harper said the government is on track to balance the budget this year.

"Only our Conservative government has a plan to protect Canada's economy by ensuring our budget remains balanced and lowering taxes to create new jobs and make life more affordable for Canadian families and seniors," he said in a statement Friday.

Earlier this month, the Finance Department said the government finished the 2014-15 fiscal year with a $1.9 billion surplus, well ahead of the $2-billion shortfall that was predicted in the spring budget.

The 2014-15 surplus ended a streak of six straight deficits under the Conservatives.