The legislature’s speaker delivered the deciding vote to make it 153-152, ending a stalemate and averting a potential snap election.

“The government respects the fact that the margin of tonight’s vote was very narrow. Indeed that is an understatement,” Mr Martin told parliament.

The confidence vote was the first test of support for a Canadian minority government since 1979.

The motion was held during a debate on Canada’s budget.

“This was not just a budget vote. It was about a vision of Canada. It was about a perspective of the country,” said the prime minister.

“We must now move forward in a spirit of cooperation,” he said.

“We ask the opposition to join with us in a renewed effort to make this parliament work for the people of Canada.”

However Conservative leader Stephen Hopper vowed to continue to provide vigorous opposition.

The outcome nevertheless has done little to dispel accusations of corruption within the Liberals.

Mr Martin’s government has been under pressure over allegations dating back to the 1990s that centre on misused government funds and allegations of kickbacks to senior party members in exchange for federal advertising contracts.

A report issued by Canada’s auditor-general last year said the governing Liberal in the late 1990s systematically channelled at least C$100 million (A$105m) of taxpayer money to advertising agencies tied to the party, for little or no work.

Mr Martin’s predecessor Jean Chretien was in power at the time, and Mr Martin, then finance minister, is not personally implicated.

The vote came on the same day as a royal visit from Queen Elizabeth.

Mr Martin won with the help of Conservative-defected politician Belinda Stronach.

Ms Stronach, a billionaire auto parts heiress, gained a cabinet post after joining the ruling Liberals.

Independent MP Chuck Cadman also voted with the government, however did not announce his voting intentions before the ballot.

He sided with the government because constituents from his poor, rural electorate in the western British Columbia need the social benefits included in the budget, he said.