(Recasts with quotes from analysts, opposition)
By Leah Schnurr
OTTAWA, Sept 1 (Reuters) - Having staked his reputation on strong economic management, Canadian Prime Minister Stephen Harper has decided that the best way to win re-election when the headlines say recession is to convince the country it is no longer in one.
Tuesday brought the worst kind of news for a prime minister campaigning for a rare fourth term in office: government data that confirmed Canada's economy contracted for the second quarter in a row, the technical definition of recession.
But Harper shrugged off the data from the first half of the year, saying Canada had a "couple of weak months," and pointed to June growth numbers that suggest the future is brighter than the past.
"The Canadian economy posted very strong growth in June. Strong growth is expected for the balance of the year ... (and) we will have good growth prospects for the years to come," he told reporters during a campaign stop in Burlington, Ontario.
To be sure, the June rebound also spurred some economists to predict growth would return in the third quarter.
While Harper has been quick to argue that the slump in Canada's energy sector is due to global forces beyond his control, the risk is voters will blame the incumbent as they head to the polls Oct. 19.
"Governments do poorly historically when going to the polls in or soon after a recession, regardless of whose fault it is," said Robert David, an economist and professor of social sciences at the University of Ottawa.
In a tight three-way race between Harper's right-leaning Conservatives and two center-left opposition parties, the economy has emerged as a defining issue. Harper has presented himself as the steady hand on the tiller; his opponents argue he's the one who sank the ship.
"Mr. Harper keeps repeating that his plan is working, but this is the second recession he's had," Liberal leader Justin Trudeau said during a campaign stop in Quebec.
New Democratic Party (NDP) leader Thomas Mulcair said the numbers showed Harper's plan wasn't working and Canada was ready for change.
A recent poll by Ipsos put the left-leaning NDP ahead with 33 percent support, followed by the Liberals with 30 percent and the ruling Conservatives with 29 percent.
"The announcement today is not helpful for the prime minister, but the mood of Canadians about the economy was already darkening - and a darkening mood was definitely weakening the prospects for the Conservatives," said Bruce Anderson, chairman at pollster Abacus Data.
The recession that has gripped the country has been felt most acutely in the resource-rich western province of Alberta, which elected a left-leaning NDP government in May to end a 44-year Conservative reign - a grim harbinger for Harper.
Manufacturers in Ontario, the most populous province, have also felt the pinch, with many employers too uncertain to invest and boost jobs. Voters in Toronto and Vancouver are also struggling with record housing costs.
An Abacus poll ahead of the GDP report showed 59 percent of voters thought the economy was in poor health, while 41 percent said it was in good shape.
Both opposition parties have accused the Conservatives of focusing too narrowly on the energy industry, leaving the country overly dependent on oil.
With recession dominating the headlines, the parties are now trying to convince voters they have the best solution: spend and stimulate, keeping the federal budget in deficit for a few more years, or tough fiscal discipline to guard a balanced budget.
Trudeau is the farthest out on a limb in terms of backing stimulus. The son of former Prime Minister Pierre Trudeau announced last month he would run deficits and use the money for a national infrastructure program - a plan Harper has derided as foolish and risky.
Both the Conservatives and the New Democrats have said they will balance the budget, though Harper's forecast for a balanced budget this fiscal year has been challenged and the NDP has also made a number of spending promises. (Additional reporting by David Ljunggren in Ottawa and Andrea Hopkins in Toronto; Editing by Jeffrey Hodgson and Andrea Ricci)