Argentina on Monday took a “giant step” toward resolving a long-running legal battle with hedge funds over the South American nation’s defaulted debt, a court-appointed mediator said.

The Argentine government has agreed to pay $4.65 billion to four hedge funds, attorney Daniel Pollack said in New York.

Buenos Aires has until 12 p.m. on April 14 to make the payment, “in cash and in dollars,” the mediator said.

“This is a giant step forward in this long-running litigation,” Pollack said, though adding, it is “not the final step.”

Asked what was the main stumbling block during the negotiations, he replied “money,” referring to the demands pressed by U.S. billionaire Paul Singer, the man behind one of the hedge funds, NML Capital.

NML, Aurelius, Davidson Kempner, and Bracebridge Capital are getting 75 percent of the judgments awarded them by U.S. District Judge Thomas Griesa, which include principal, interest, legal fees and a payment for settling outside of court.

Argentina defaulted on roughly $100 billion in debt in December 2001, at the time the largest sovereign default in history.

The vast majority of Argentina’s creditors – around 93 percent – accepted steep haircuts on the sovereign bonds, which were issued under U.S. law, in 2005 and 2010 restructurings.

Some of the remaining 7 percent resorted to litigation.

Griesa ruled in favor of one group of holdouts in 2012, including NML Capital Ltd.

Citing a violation of the bonds’ “pari passu” (equal treatment) clause, he ordered Argentina to pay them $1.3 billion plus interest before making further payments to bondholders who had accepted the restructurings.

Other holdout bondholders, known as “me too” litigants, won similar judgments against Argentina in Griesa’s court last year, bringing the total owed by the South American country to the litigants to around $10 billion.

Argentina was blocked from making interest payments to the 93 percent of creditors that accepted the 2005 and 2010 restructurings when it refused to comply with Griesa’s judgments in favor of the holdouts, leading credit ratings agency Standard & Poor’s to lower the country’s credit rating to “selective default” in 2014.

The mediation effort entered a new phase in December with the coming to power in Argentina of conservative businessman Mauricio Macri.

He quickly signaled that he would be more flexible than leftist predecessor Cristina Fernandez, who denounced the hedge funds as “vultures.”

On Feb. 19, Griesa said he was ready to lift the injunction against interest payments to exchange bondholders provided that Argentina repeals a law prohibiting payments to the holdouts and that it pay off bondholders who settle by Monday.

As part of the agreement in principle announced by Pollack, the holdouts pledge not to interfere with the Argentina government’s plans for a new bond issue to fund the settlement with the hedge funds.

Pollack had praise for the Macri administration, hailing what he called their “course-correction” as “nothing short of heroic.”

NML Capital and other hedge funds acquired Argentine bonds on the secondary market at large discounts following the 2001 default.