The International Monetary Fund says it has reached an agreement to offer Argentina a $50 billion bailout.

That would be the largest IMF credit line in history.

A flailing currency and soaring twin deficits have been plaguing the country's economy.

Argentina looks poised to get the biggest International Monetary Fund bailout in history.

The IMF reached a staff-level agreement Thursday to offer Argentina, which requested aid last month when its currency hit an all-time low, a $50 billion loan as part of a three-year standby program. The credit line seeks to rein in soaring twin deficits in the country and prop up the Argentine peso.

"I am pleased that we can contribute to this effort by providing our financial support, which will bolster market confidence, allowing the authorities time to address a range of long-standing vulnerabilities," the IMF's managing director, Christine Lagarde, said in a statement.

Investors have been pulling cash out of the country, and the Argentine peso has fallen more than 36% versus the US dollar this year, even amid aggressive contractionary policies. The Central Bank of Argentina raised interest rates three times last month to 40%. The government recently announced hefty spending cuts and increases in utility prices.

As part of the deal, the Argentine government is asked to ramp up those spending cuts and end central-bank financing of the federal deficit. Most notably absent from IMF stipulations is a fixed exchange rate, which many economists see as playing a central role in worsening the country's most recent crisis.

"This measure will ultimately lessen the government financing needs, put public debt on a downward trajectory, and as President Macri has stated, relieve a burden from Argentina's back," Lagarde said.

Argentina has had a complicated relationship with the IMF, which has been blamed for worsening the country's economic crisis in 2001, mostly through eliminating a floating exchange rate. After President Mauricio Macri announced negotiations with the IMF last month, nationwide protests broke out.

Stuart Culverhouse of Exotix Capital said the IMF deal would be received positively by markets. But he's remaining cautious on how quickly its structural effects could take effect ahead of elections in the country, which take place in October 2019.

"The agreement shows there is lot of international support to make Macri's Argentina work, and it should ease financing and political concerns this year," Culverhouse said. "But delivering the fiscal adjustment and lower inflation next year, an election year, could still prove challenging."

Capital Economics analyst Edward Glossop is skeptical for different reasons. Glossop wrote in a note to clients last month that a "full-blown" bailout could push the economy into a deeper downturn through government stipulations, including accelerated budget cuts.

"The IMF does to some degree take these factors into account, but in general, it tends to favor a quick and front-loaded adjustment," he told Business Insider.

The deal still needs to be approved by the IMF's Executive Board, which is expected to happen later this month.

Read more about Argentina's 2001 economic crisis here.