– The Canadian economy shrank again in the second quarter, putting the country in recession for the first time since the financial crisis, with a plunge in oil prices spurring companies to chop business investment.

The confirmation on Tuesday of a modest recession will figure heavily into the election campaign as Canadians head to the polls Oct. 19 and poses a challenge to Conservative Prime Minister Stephen Harper, who is seeking a rare fourth consecutive term.

Still, there was a silver lining as growth picked up for the first time in six months in June, underscoring expectations the recession will be short-lived.

Harper was quick to downplay what some supporters and economists have dismissed as a “technical” recession, pointing to the upbeat June figures during a campaign stop. “The Canadian economy is back on track,” he said.

But politicians from the opposition New Democrats and Liberals said the numbers were evidence Harper’s economic policies were failing.

Economists mostly agreed the 0.5 percent pickup in June put Canada on good footing for a better third quarter.

“Despite the technical recession materializing, it does look like the Canadian economy is jumping back, is rebounding strongly in the third quarter,” said Derek Burleton, deputy chief economist at Toronto-Dominion Bank.

The Canadian dollar initially rallied to a session high against the greenback following the data before giving up ground later in the day as oil prices fell.

The last time Canada was in recession was in 2008-09, when the U.S. housing market meltdown triggered a global credit crisis.

This time around, Canada has been primarily hit by the slump in crude prices, with weakness concentrated in energy-related sectors. Oil-exporting provinces like Alberta and Saskatchewan have been particularly hard-hit.

Gross domestic product contracted at an annualized 0.5 percent rate in the second quarter, Statistics Canada said. That was better than forecast, though revisions showed the first quarter’s contraction was steeper than first reported.

Two consecutive quarters of contraction are typically considered the textbook definition of a recession. But some economists have argued that such a definition is too narrow.

They note unemployment has remained relatively subdued at 6.8 percent, and housing markets outside of Alberta and retail sales have been reasonably strong.

“The weakness in the first half of the year does appear to be fairly narrowly based, with weakness in the energy sector weighing on investment activity,” said Paul Ferley, assistant chief economist at Royal Bank of Canada.