Lawmakers in Argentina on late last week approved a deal with the International Monetary Fund (IMF) to restructure a ruinous $45 billion debt ahead of a vote in the upper house.

With 204 votes in favour, 37 against and 11 abstentions, the package obtained “an affirmative result and will be communicated to the honourable Senate”, chamber president Sergio Massa said.

The details of the deal were ironed out between Argentine officials and IMF staff after an in-principle agreement in January.

“This is the best refinancing agreement that could be achieved,” lawmaker Carlos Heller from the pro-government Frente de Todos (Everyone’s Front) said.

A rejection of the package “would lead us into serious problems that we must avoid at all costs”, he added ahead of the session that lasted until early in the morning of March 11.

In 2018, under the government of conservative President Mauricio Macri, the IMF approved its biggest-ever loan of $57 billion to Argentina. The country received $44 billion of that amount.

Macri’s successor Alberto Fernandez refused to accept the rest, seeking also to renegotiate repayment terms. Payments of $19 billion and $20 billion were due this year – a timeline the government considered impossible.

Argentina is just emerging from three years of economic recession and battling rising inflation and a high poverty rate.

Under the new deal, repayments will be made from 2026 to 2034 after a grace period.

As well as going through the Senate, the package must also be ratified by the IMF board of directors before it comes into force.

Despite reluctance from a sector of Frente de Todos and the opposition coalition Juntos por el Cambio (Together for Change), the lawmakers passed the refinancing deal, but many have questioned the economic programme that will accompany it.

“This is not the time for opportunism,” said Juntos por el Cambio member of parliament (MP) Facundo Manes.

“The opposition must give [the government] the chance to restructure the debt, but we cannot take responsibility for the programme that the government negotiated with the IMF.”

As expected, minority figures on the left and on the libertarian right were opposed to the agreement.

Pro-government MP German Martinez said the deal gave “time that allows us to consolidate, boost a process of economic recovery”.

“That will allow us to be in better shape in four-and-a-half years to start facing the payments, and we are going to make them without adjustment,” he said.

Argentina hopes to reduce its fiscal deficit from 3.0 per cent of gross domestic product (GDP) today to 0.9 per cent by 2024.

There were protests against the deal outside parliament, with some demonstrators burning rubbish and throwing stones towards the building entrance.

A police officer was hit by a Molotov cocktail and some windows were hit with stones, including those at the offices of the Senate president and Vice-President Cristina Kirchner.