After 13 hours of debate, Argentina’s senate voted overwhelmingly to approve a deal with creditors in the US, putting an end to a dispute that had lasted 15 years.
The deal was reached in late February, and the house of deputies passed it earlier this month.
The senate began debating on Wednesday morning and around 1am local time on today passed the measure by 54 votes to 16.
It puts an end to a bitter chapter that made Argentina a financial pariah and was often a point of sharp political clashes.
The vote is also a boost for President Mauricio Macri, who campaigned on promises to restart the continent’s second largest economy, in large part by solving a dispute so complex it led to changes in how debt contracts are restructured worldwide.
While Mr Macri’s PRO party does not control either chamber in congress, most analysts had predicted the measure would pass because Argentina is strapped for cash and needs foreign investment to begin growing after four years of economic stagnation.
Mr Macri’s predecessor as president, Cristina Fernandez, had refused to negotiate with the creditors, calling them “vultures” who were trying to bully Argentina.
The issue was a central part of last year’s presidential campaign. Mr Macri and his opponent Daniel Scioli, Ms Fernandez’s chosen successor, clashed over whether a deal was necessary and who would be the tougher negotiator.
The seeds of the dispute go back to 2001-2002, when Argentina defaulted on $100bn (€88.4bn) debt.
Most holders of the original debt, along with those who bought up bonds in the aftermath, agreed to swaps in 2005 and 2010 for bonds worth far less.
But a group of creditors led by billionaire hedge fund manager Paul Singer refused.
They took Argentina to court in New York, where the debt was issued, and won.
US District Court Judge Thomas Griesa in New York repeatedly ruled against Argentina, saying the country had to pay the holdouts before it could pay other creditors holding renegotiated debt.
Those rulings kept Argentina from accessing international credit markets, forcing it to issue domestic bonds and search for back-door financing from countries like China.
During the years of fighting, the initial debt ballooned as other holdout groups began suing and legal fees mounted.
The long, costly dispute led to changes in how debt is issued worldwide. Many countries have restructured contracts in attempts to avoid getting into similar situation.
Under the deal, Argentina will pay $4.653bn to resolve claims related to the court fight.