Canada's Prime Minister Stephen Harper speaks on Parliament Hill in Ottawa

Canada has posted its first federal budget surplus since the 2008 financial crisis, despite falling oil prices, the government said Monday.

The news was good for Canada's ruling Conservatives, coming just a month before legislative elections and at a time when polls show the country's three major parties nearly even.

Prime Minister Stephen Harper hailed the result as evidence his government's policies are "delivering new jobs and economic growth through lower taxes and a balanced budget."

The Finance Department said the Can$1.9 billion surplus was posted at the end of the fiscal year, which closed March 31. It followed a Can$5.2 billion deficit the previous fiscal year.

Canada's two main opposition parties -- the leftist New Democrats and the centrist Liberal parties -- have charged that the Conservatives have made the economy too dependent on raw materials, including oil.

A steep fall in oil prices over the past year plunged the Canadian economy into recession during the first two quarters of the year.

Despite the slowdown, the government has received Can$3 billion more in revenues than expected, resulting in the surplus, the Finance Department said.

The federal debt was Can$612 billion on March 31, up Can$400 million, and the country's overall debt was 40.4 percent of GDP.