OTTAWA -- It-could-be-worse squared off against it-could-be-better Thursday as the main federal party leaders took to an election debate stage in Calgary to lay out their economic visions -- and try to break a three-way deadlock in the polls.

Stephen Harper, looking to extend his Conservative government rule into a second decade, maintained that a stay-the-course, tax-cutting agenda with balanced federal budgets is the safe road to prosperity.

Liberal Leader Justin Trudeau animatedly countered that now's the time for some national optimism and investment in the future -- even if it comes at the expense of a balanced budget.

Literally between them in a room at the BMO Centre in Stampede Park, NDP Leader Tom Mulcair tried to split the difference, arguing it's time to let a New Democrat government take the helm after a uniform Canadian history alternating between Grits and Tories in power -- and to give Canadians a choice between Harper's "snooze button" and Trudeau's "panic button."

But it was Harper's calm, phlegmatic approach, contrasted with Trudeau's aggressive machine-gun jabs that set the dynamic for the sharp-elbowed, 90-minute exchange.

The prime minister acknowledged several times that economic growth hasn't been strong under his watch, but made the case that Canada has weathered international storms better than anyone else in the developed world.

"It hasn't been great because we are living in a terribly unstable global economy," Harper said at one point.

"I've never said things are great," he added at another, before stressing Canada's comparative global advantage.

"Where would you rather have been but in Canada?" he asked. "Looking forward, where would you want to be but Canada?"

Trudeau, who has been the subject of derisive Conservative advertising campaigns questioning his experience and competence since he was first elected Liberal leader in 2013, repeatedly talked over Harper to make his case that Canada's moribund economy needs growth and government can help deliver it.

The lone leader in the debate who is proposing to run deficits over the next three years, Trudeau challenged Harper by likening Canadians to homeowners taking on a mortgage or a renovation loan.

With rock-bottom interest rates and slack in the economy, "If this isn't the time to invest, what would be?" asked Trudeau.

"This is the time to invest in the future of our country. Canadians know this. The only two people who don't know this are the two gentlemen on this stage."

Harper responded that the Conservatives are doing exactly that, without raising taxes and while balancing the books.

Just more of the same, argued Mulcair.

"For the first time in our history, there is another choice," said the former Quebec Liberal cabinet minister.

He painted both the federal Liberals and Conservatives as cynical and scandal-prone.

"I'm tired of watching successive Liberal and Conservative governments dump these massive ecological, economic and social debts on the backs of future generations," said Mulcair, who says he won't run deficits while investing in social programs, but will raise corporate income taxes.

The debate, sponsored by the Globe and Mail, was supposed to focus on the economy, Harper's comfort zone, but at times veered into more swampy territory such as climate change and refugee policy.

Both Mulcair and Trudeau attacked the Conservative leader over his government's treatment of minorities and refugees, which prompted one of the most spirited exchanges of the evening.

Harper accused the opposition parties of ignoring security concerns in their rush to embrace the Syrian refugee flood that has captured the world's attention.

"These guys would have had, in the last two weeks, us throwing open our borders and literally hundreds of thousands of people coming without any kind of security check or documentation. That would have been an enormous mistake," said the prime minister, as Trudeau gamely interjected, "That's not true, Mr. Harper."

"Mr. Harper plays to fears all the time," Trudeau shot back. "Fears of others, fears of different communities. We have a prime minister who prefers to pander to fears. That's not right, sir."

Mulcair then cited a Conservative policy stripping refugees of some health care benefits, a policy that's being contested in courts.

Harper asserted otherwise.

"We do not offer them a better health plan than the ordinary Canadian can receive," said the Conservative leader. "That's something that most new and existing and old-stock Canadians agree with."

The inflammatory exchange sets the stage for more fireworks at a French-language leaders' debate in Montreal next Thursday, followed by a foreign policy debate in Toronto the following Monday.