The federal government ran a deficit of $12.7 billion over the first eight months of its 2016-17 fiscal year — compared with a $1-billion surplus during the same period a year earlier.

The shortfall was due to a $14-billion surge in expenses, including a $7.1-billion increase in direct program costs to the treasury, the Finance Department latest monthly fiscal monitor showed Friday.

The double-digit deficit figure wasn't a surprise since the Trudeau government has pledged to run deficits over the coming years as it tries to boost the economy through infrastructure investments and larger child benefits.

The fiscal monitor said the April-to-November spike in expenses included multibillion-dollar increases in payments for child and seniors benefits as well as bigger transfers to other levels of government.

Over the same period, the government said its revenues were down $1.1 billion compared with the year before, a decline due to the one-time gain in 2015 from Ottawa's $2.1-billion sale of its holdings in General Motors.

For November alone, the report said Ottawa's books showed a $3.3-billion deficit — down from a $400-million surplus in November 2015. Overall revenues, it added, decreased by $1.7 billion in November 2016, mainly due to declines in personal and corporate tax revenues.

Finance Minister Bill Morneau's fall economic and fiscal statement projected a deficit of $25.1 billion this year, followed by annual shortfalls that are expected to shrink over the coming years to $14.6 billion in 2021-22.

The government has not provided a timeline to balance the books.

The Liberals won the 2015 election on a platform that promised annual deficits of no more than $10 billion over the next couple of years. The Liberals had also pledged to eliminate the deficit by 2019-20.