The federal government has taken in $5 billion more than it spent since April, the Department of Finance revealed Friday.

In the monthly Fiscal Monitor Ottawa revealed that government revenues came in at $24.3 billion in June, a surplus of $1.1 billion more than what the government spent. The monthly surplus was smaller than last year's June surplus, which came in at $1.6 billion.

But for the first three months of Ottawa's fiscal year as a whole, which starts in April, Ottawa posted a surplus of $5 billion. That was well ahead of the $400-million first quarter surplus that Ottawa posted last year.

In a release, the government credited the sale of its remaining stake in General Motors with much of the surplus. In April, Ottawa sold off the last chunk of the shares it acquired in 2009 when Ottawa and the Province of Ontario bailed out the automaker.

April's GM stock sale raised about $2.7 billion for Ottawa's coffers. The government also raised similar amounts in previous sales, but collectively the total was not enough to recoup Ottawa's entire financial investment.

The GM sale wasn't the only reason for the surplus, however. Revenues for the three-month period were $73.3 billion, up by $6.2 billion, because of more money from "income taxes, excise taxes and duties," the government said in a release.

The higher revenue more than offset expenses, which rose by $2.2 billion to $61.3 billion for the month.

That gap between expenses and income is $12 billion, but the surplus shrinks to $5 billion once the $7 billion Ottawa spent financing the national debt is factored in.

On the debt front, Ottawa also took advantages of lower interest rates, as the amount the government spends to finance its debt decreased by $600 million or eight per cent during the quarter.

Broadly speaking, Ottawa's finances tend to oscillate between surplus and deficit from month to month, no matter if the annual figure is positive or negative, due to seasonal factors. The financial picture generally looks more positive in the winter months between December and April, for example, because those months tend to have higher personal and corporate income tax revenues. Revenues during the summer months, meanwhile, tend to be a little lower as economic activity slows down.

In its budget in April, Ottawa was forecasting a slight surplus of $1.4 billion for the current fiscal year 2015.