Canada's parliament has narrowly approved Prime Minister Mark Carney's first federal budget, allowing his minority Liberal government to avert an early election.

The fiscal plan, which raises Canada's deficit to a projected C$78 bn ($55.3 bn; £42.47 bn), was passed thanks to crucial support from opposition MPs, including Green Party leader Elizabeth May.

Many opposition lawmakers have sharply criticised the fiscal plan - the second largest in history. The plan passed with 170 votes in favour and 168 against it.

Carney, who served as the former central banker for both Canada and the UK, has defended the budget as a generational investment to help Canada strengthen its economy.

The vote was crucial for Carney's Liberal government, which currently sits two seats short of a majority.

It meant that if all 169 Liberal MPs voted in support, the budget would need the backing from either two opposition MPs, or have four opposition MPs abstain.

Two NDP MPs abstained along with House Speaker Francis Scarpaleggia, who casts a vote in the event of a tie. Conservative MPs Shannon Stubbs and Matt Jeneroux - who announced earlier this month that he was resigning - also abstained.

Green Party leader Elizabeth May's support also proved crucial. May told reporters she voted yes based on commitments made by Carney that he would support Canada's climate targets.

Without what I heard from the Prime Minister today, I would have voted no, she said.

The Conservative Party, led by Pierre Poilievre, and the Quebec nationalist Bloc Québécois both voted against the budget, accusing Carney's government of failing to address affordability concerns.

Poilievre labelled the budget a credit card budget, arguing it does little to tackle the cost-of-living crisis.

The budget proposes C$140bn of new spending over the next five years to strengthen Canada's productivity, competitiveness, and resilience. It includes provisions to update ports and trade infrastructure to double Canadian exports to non-US markets over the next decade.

Additionally, the fiscal plan allocates direct support for businesses impacted by US tariffs, with projected initiatives anticipated to attract C$1 trillion in private sector investment over the next five years.

To balance the fiscal plan, Carney has proposed cutting the federal workforce by 10% over the coming years, a move that has drawn strong criticism from public sector employees, who caution that this will slow government operations.

Debate around the budget has been overshadowed by partisan drama. Carney's Liberals recently gained a member from the Conservative Party, fuelling questions about party leadership.

Chris d'Entremont of Nova Scotia defected to the Liberals, expressing dissatisfaction with Conservative leadership. Meanwhile, Poilievre has vowed to continue as leader, insisting he will fight for an affordable Canada.