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

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 (€1.27bn) surplus was posted at the end of the fiscal year, which closed on 31 March.

It followed a Can$5.2 billion (€3.46bn) 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 (€2bn) more in revenues than expected, resulting in the surplus, the Finance Department said.

The federal debt was Can$612 billion (€407bn) at the end of March - up Can$400m (€266m), and the country's overall debt was 40.4% of GDP.