Canada's finance minister says Canada is not in recession now and wasn't in recession in the first half of the year despite data showing otherwise.

Joe Oliver said in an interview with The Associated Press the downturn was largely confined to the energy sector. Canada fell into a recession in the first six months of the year, dragged down by falling energy prices and economic troubles in China.

The Canadian economy retreated at an annual pace of 0.5 per cent from April through June after sliding 0.8 per cent the first three months of the year. Two consecutive negative quarters are the technical definition of a recession.

"We don't believe that the economy was, in fact, in a recession," said Oliver, whose Conservative Party is seeking re-election on Oct. 19.

"We're really talking about a contraction in the energy and resource sector of the economy which is less than 20 per cent of the economy. Granted, there is a spillover, but the other 80 per cent was growing."

Oliver, who is running for re-election in the Toronto riding of Eglinton-Lawrence, has been noticeably absent from the campaign trail. Other high-profile Tory ministers have instead appeared at economy-themed announcements and campaign events that would seem well within the purview of the finance minister.

When pressed on Oliver's absence, Conservative candidate and acting defence minister Jason Kenney told reporters that Oliver has been "working hard in his constituency," where he faces a heated three-way race with Liberal candidate Marco Mendicino and NDP candidate Andrew Thomson.

Risks remain, finance minister warns

Oliver noted the economy grew at 0.5 per cent pace in June, the first monthly gain in six months. He said whether Canada was in recession is a matter of continuing debate.

"But I can tell you this, we don't believe we're in a recession at all now," Oliver said. "The trade numbers are robust. Consumer confidence is good, and we returned a budget surplus."

Canada is the world's 11th-biggest economy and the biggest trading partner of the U.S. The Canadian economy suffered far less damage from the 2008 financial crisis and Great Recession than its southern neighbour. But news this month of a recession spelled trouble for Conservative Leader Stephen Harper. Polls show the election is a three-way toss-up. Harper is campaigning for a rare fourth term as prime minister on a record of economic growth.

Beata Caranci, chief economist for TD Bank, said while the Canadian economy did technically contract in the first half of 2015, the job and housing markets held up well and forward indicators show Canada is looking at a "pretty nice rebound."

"I feel confident that we're on a pretty good expansion path right now," Caranci said.

Craig Wright, chief economist at the Royal Bank of Canada, called the first half of the year a "soft patch" rather than a recession and said conditions have improved. "You are looking at a 0.1 per cent drop on a two trillion economy. It's kind of a rounding error, and it may be revised away," Wright said.

Oliver, however, said the Conservatives are mindful of the external risks to the Canadian economy.

'We're in a period of growth'

According to a government memo prepared for Oliver on the global economy, the trade impact on Canada of a more prolonged slowdown in China would be significant given that China is Canada's second-largest export partner, with exports equivalent to roughly one per cent of Canadian GDP.

But Oliver said the global economy is not in crisis like it was in 2008 and Canada doesn't need the stimulus spending the opposition Liberals are advocating. The Liberals vow to invest in infrastructure to get the economy going and say they'll run deficits of $10 billion in each of the next three years if elected.

Canada posted a budget surplus after six straight years of deficits. The government earlier this month announced a $1.9 billion Canadian surplus for last year.

Oliver, who met with finance ministers and central bank governors from the Group of 20 leading economies in Turkey earlier this month, said other countries could learn from Canada.

"The contrast is very clear. When I was sitting around the table in Ankara, I couldn't help but think that if some of these other countries that we are talking about had followed our path of low taxes and balanced budgets, they wouldn't be in the difficulty they are today," Oliver said.

"We're in a period of growth, and we're anticipating our surpluses to get larger in the years ahead."

Oliver, previously the country's natural resource minister and a strong proponent of the Keystone XL pipeline, did the interview on Tuesday just before U.S. Democratic presidential contender Hillary Clinton said she opposes the controversial pipeline. Harper said as recently as last month that he was confident that whoever became the next U.S. president would approve Keystone. News that Clinton opposes it is a blow to Canada, which needs infrastructure to get its oil to market. Canada has the world's third largest oil reserves.

Wright, the economist, however, said the pipeline isn't as critical to the Canadian economy as it once was as oil companies have increasingly used trains to get oil to market.