THE timing took many by surprise. On June 7th, just four weeks after negotiations began, Argentina’s government declared that it had secured a three-year credit line with the IMF worth $50bn. The deal’s size is likely to reassure investors of Argentina’s solvency. Its speed is a sign of the fund’s confidence in Mauricio Macri, Argentina’s business-friendly president. But for ordinary Argentines, many of whom blame the IMF for the country’s disastrous $82bn default in 2001, the announcement carries echoes of a painful past.

An acute currency crisis meant Mr Macri had little alternative but to seek the IMF’s help. In April the yield on American ten-year Treasury bonds rose to 3% for the first time since January 2014. That prompted a widespread sell-off in emerging markets. The currencies of Turkey, Russia and Mexico were all battered; Argentina’s was particularly badly hit. Investors were spooked by the country’s large fiscal and current-account deficits, and a rapidly growing pile of foreign-currency debt. They also doubted the independence of the central bank, which in January had cut interest rates at the behest of the government, despite inflation of 21%.

As investors pulled their money out of Argentine assets, the peso plunged by one-fifth against the dollar. Between April 23rd and May 4th the central bank raised interest rates by 12.75 percentage points to 40% and sold $5bn of its currency reserves in an effort to arrest the decline. Nicolás Dujovne, the treasury minister, tried to win back investor confidence by cutting the target for this year’s primary budget deficit (ie, before interest payments) from 3.2% to 2.7%. None of that worked. As the peso continued to slide, Mr Macri appeared on television on May 8th to announce the country had approached the IMF for a credit line.

The details of the “standby arrangement” should help soothe investors’ nerves. The first tranche of credit, worth $15bn, will be disbursed shortly after the IMF’s executive board approves the deal on June 20th. Further disbursements will be at the discretion of Argentina’s government. The interest rate will vary between 1.96% and 4.96%, depending on how much money the government chooses to use. After a three-year grace period, each disbursement must be repaid in eight quarterly instalments. The arrangement “reduces the reliance on more expensive and less stable private market sources,” said Alberto Ramos of Goldman Sachs in a note.

So far, so generous. But the IMF has demanded new commitments from Argentina on fiscal and monetary policy. The government must eradicate its primary deficit by 2020, a year earlier than it had planned, and run an overall surplus in 2021. While the fiscal targets have been tightened, inflation targets have been loosened. With markets expecting inflation of 27% this year, the central bank has been persuaded to abandon its wildly optimistic target of 15% for 2018 and will instead aim for 17% in 2019, falling to 9% in 2021. The new figures “are demanding but not unrealistic”, says Mr Ramos. The central bank will also stop its partial financing of the fiscal deficit and will have its independence enshrined in law. The government is expected to send a proposal to congress to strengthen the bank’s charter.

The deal obliges Mr Macri to inflict further austerity on Argentines. After taking office in 2015 he sought to repair gradually the economic imbalances bequeathed by his predecessor, Cristina Fernández de Kirchner. That required his government to borrow billions of dollars on international credit markets to plug the budget shortfall. That strategy came to an abrupt end in April, when interest rates rose and investors lost patience with the slow pace of his reforms. The credit line provides him with some breathing space. Mr Macri will hope to use it to recover his approval ratings, his lowest since taking office, in time for elections in October 2019.

It will be no easy task. Argentines are weary of austerity and are unlikely to thank Mr Macri for providing them with more of it, particularly at the behest of the IMF. In 2001 the IMF offered loans in exchange for commitments to cut spending. When the government reneged, the fund pulled the plug and the country defaulted. Although the politicians were chiefly to blame, the IMF’s reputation has never recovered. A poll conducted in May found that three-quarters of Argentines were opposed to any sort of arrangement with the fund. If Mr Macri is to stand a chance of re-election next year, he must convince voters that the alternative would have been far worse.