OTTAWA (Reuters) - 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.

Construction workers build a new house in Calgary, Alberta, April 7, 2015. House prices have fallen in Calgary after the price of oil plummeted late last year according to local media reports. REUTERS/Todd Korol

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.

The Bank of Canada has cut interest rates twice this year in an effort to revive the economy, though most analysts expect it to hold rates at 0.5 percent when it meets next week.

While the price of oil and other natural resources have weakened since June, many expect non-commodity Canadian exports to benefit from a strengthening U.S. economy, which grew at a 3.7 percent clip in the second quarter.

Canadian exports of goods and services rose modestly in the second quarter, though business investment slumped and inventory accumulation slowed.

Activity in the goods-producing industries declined 2 percent on a quarterly basis, with a 4.5 percent drop in the mining, quarrying and oil and gas extraction component. But a rebound in that same sector helped the economy perk up in June.

Separate data showed the manufacturing sector turned down again in August, with the RBC Canadian Manufacturing Purchasing Managers’ index falling to a seasonally adjusted 49.4.