Sri Lanka on Monday secured a much-anticipated loan of about $3 billion from the International Monetary Fund (IMF) as the South Asian nation navigates its worst financial crisis in decades. The deal, nearly a year in the making, will aim to “restore macroeconomic stability and debt sustainability” and “unlock Sri Lanka’s growth potential,” the IMF said in a statement. The island nation of 22 million was rocked by weeks of unrest last year caused by crippling food, fuel and medicine shortages after its foreign exchange reserves plummeted to record lows, with dollars running out to pay for essential imports. Millions were left unable to feed their families, fuel their vehicles or access basic medicine. The country’s former president was forced to flee the country after angry protesters stormed his residence and office, demanding his resignation. In July last year, President Ranil Wickremesinghe said Sri Lanka is “bankrupt,” adding negotiations with the IMF were “difficult.” Monday’s loan approval will provide much-needed respite for the nation as it faces an uphill climb to revive its flailing economy. The IMF will immediately disburse an initial $333 million to Sri Lanka, with more funds to follow in the coming months. In a statement Monday, Wickremesinghe praised the IMF’s decision, saying: “In the 75 years of Sri Lanka’s independence, there has never been a more critical period for our economic future.” The program will be “imperative to improving Sri Lanka’s standing in and access to international capital markets, and it will demonstrate that Sri Lanka is once again a country attractive to talent, investors and tourists,” he said. The loan will be provided through the IMF’s Extended Fund Facility (EFF), a mechanism set up to provide financial assistance to struggling countries. “For Sri Lanka to overcome the crisis, swift and timely implementation of the EFF-supported program with strong ownership for the reforms is critical,” IMF managing director Kristalina Georgieva said in a statement. This time last year, Sri Lankans were forced to line up for hours to buy fuel, sometimes clashing with police and the military as they waited. Rice, a staple in the country, had disappeared from shelves in many stores. Amid the crisis, more than 300,000 people left the country last year to work overseas – the highest number ever recorded, according to the government. While conditions have improved slowly, anger has remained over the country’s financial situation. At least one person died last month after police fired tear gas and water cannons at protesters who had gathered in the commercial capital Colombo to protest the postponement of local elections that the government could not afford to hold. Wickremesinghe previously told parliament that no local elections would be held until the country’s economy is on the right track. “The economy is my top priority. We will not have a country if the economy does not develop,” Wickremesinghe said at the time.