TORONTO (AP) — Canada has posted a budget surplus after six straight years of deficits.

The government announced Monday a $1.9 billion Canadian (US$1.4 billion) surplus for last year. It had been predicting a $2 billion Canadian ($1.5 billion) deficit with expectations for a surplus this year.

The good news for Conservative Prime Minister Stephen Harper comes as he seeks a rare fourth term in the Oct. 19 election and just before he participates in a debate on the economy on Thursday.

Harper said there is a zero chance of a deficit this year despite the sharp downturn in the price of oil. Canada fell into a recession in the first six months of the year, dragged down by falling energy prices and economic troubles in China.

"This is incredibly good news," Harper said at a campaign event in British Columbia. "In spite of all the problems of the world this country has a balanced budget."

Polls and analysts say the election is a three-way toss-up. The leftist opposition New Democrats vow to run a balanced budget if elected for the first time in Canadian history. The opposition Liberals, who governed Canada for most of last century, say they'll stimulate the economy with deficit spending on infrastructure if elected.

The Canadian economy retreated at an annual pace of 0.5 percent from April through June after sliding 0.8 percent the first three months of the year, Statistics Canada reported earlier this month. Canada is the world's 11th-biggest economy and the United States' biggest trading partner. The Canadian economy suffered far less damage from the 2008 financial crisis than its southern neighbor.