Ontario's minority Liberal government survived a confidence vote in Queen's Park as its proposed budget passed a crucial vote on Tuesday.

Premier Dalton McGuinty and his Liberal party were largely expected to survive the vote after securing consent from the New Democratic Party by agreeing to surtax the wealthy.

The budget passed with a vote of 52-37, with the Liberals voting in favour and the Progressive Conservatives voting against. The New Democrats abstained from the vote.

"The NDP were insistent on a tax on the rich and we were insistent on finding a way to accelerate our plan to eliminate the deficit, so we have a found a happy marriage," McGuinty told a Liberal caucus meeting following the vote.

In passing the budget, the provincial government will avoid its second election in less than a year.

Had the NDP sided with the Conservatives, the minority Liberals would have lost a confidence vote and a snap election would have been called.

On Monday, McGuinty agreed to an NDP plan that will charge an extra two per cent surtax on Ontarians with incomes of more than $500,000.

The Liberals calculate that the surtax will bring in $470 million a year, which McGuinty says will go toward paying down the $15.2 billion deficit.

The surtax will be removed when the government balances the budget in 2017-18, McGuinty said.

While the deal ensured the NDP would not vote against the budget, it had not been clear how the actual vote go down until Tuesday.

Horwath had hinted on Monday that while the NDP would not force an election they never said they would vote for the Liberal budget.

"We have achieved our shared objective. The people of Ontario won," McGuinty said.

"Ultimately it is not about the Liberals, it is not about the PC, it is not about the NDP. It is about families out there, their hopes and their aspirations."

The Conservatives, meantime, had rejected the budget from the outset and vowed to vote against it. On Tuesday, McGuinty said he was disappointed in PC Leader Tim Hudak for his refusal to "show up."

Protest inside Queen's Park

A protest erupted inside the Ontario legislative building as members of the provincial parliament debated the contentious budget plan on Tuesday.

Queen's Park security was called in to remove demonstrators gathered inside the legislature, CTV Toronto's Paul Bliss reported.

Shouts of ‘shame' could be heard coming from the legislature's viewing area before Speaker Dave Levac called for order.

The chanting protesters triggered a temporary recess shortly before Ontario's lawmakers voted on the Liberal government's budget proposal.