Portugal's parliament rejected the government's budget on Wednesday for the first time since democracy was installed in the 1970's, pushing the country towards early elections.

Socialist Prime Minister Antonio Costa lost the support of some smaller left-wing parties, who voted with the opposition against his budget.

Costa, who has led minority governments since 2015 but faced increasing opposition from his allies, vowed before the vote not to resign.

"The last thing the country needs in these circumstances is a political crisis," he said.

Portuguese Prime Minister Antonio Costa lost the support of some smaller left-wing parties
Portuguese Prime Minister Antonio Costa lost the support of some smaller left-wing parties AFP / PATRICIA DE MELO MOREIRA

The vote does not automatically trigger an early election -- the next one is scheduled for late 2023.

But President Marcelo Rebelo de Sousa has the right to dissolve parliament in his role as crisis moderator.

He had warned he would call elections if the spending plans were blocked.

"If parliament is unable to adopt a budget that's fundamental for the country, it would be positive to hear the voices of the Portuguese people, so they can say what they think about a future assembly," Rebelo de Sousa said on Wednesday.

President Marcelo Rebelo de Sousa warned he would call elections if government spending plans were blocked
President Marcelo Rebelo de Sousa warned he would call elections if government spending plans were blocked AFP / PATRICIA DE MELO MOREIRA

Before the president can dissolve parliament and set the date for elections, he must consult the various political parties and his state council.

Costa said he hoped the turmoil would result in a "stable and stronger majority".

And right-wing opposition leader Rui Rio called for elections to take place as soon as possible, which would mean January.

But political scientist Paula Espirito Santo told AFP early elections could harm most of the major players in parliament.

She said the radical left was risking "political hara-kiri" by distancing itself from the government, and parties on the right were unprepared for a vote with no unifying leader.

For prime minister and president, the deadlock leaves them unable to plan how to spend EU funds for the recovery from the coronavirus pandemic.

Costa came to power six years ago in an unprecedented union of the left, vowing to end austerity policies pursued by the right in exchange for a 2011 international bailout.

His broad alliance has struggled since 2019 and fell apart over the budget vote, with left-wing parties arguing that more needed to be done for public services.