Sri Lanka and the International Monetary Fund (IMF) have reached a preliminary agreement on an emergency loan to the crisis-hit country and a formal announcement will be made on Thursday, four sources with direct knowledge of the matter said.

The island nation, struggling with its worst economic crisis in more than seven decades, had sought up to $3 billion from the IMF.

Spokespersons for the IMF and the Sri Lankan government did not immediately respond to requests for comment.

Staff-level agreements are typically subject to the approval of the IMF management and its executive board, after which the recipient nations get access to funds.

A visiting IMF team held talks with Sri Lankan government officials, including the treasury secretary, late into the night on Tuesday to address concerns on the political front, the sources said. Most of the technical details had been agreed to beforehand.

The country of 22 million was plunged into political crisis last month when then president Gotabaya Rajapaksa fled after a popular uprising against an acute shortage of basic goods and sky-high prices.

Rajapaksa was replaced by six-time prime minister Ranil Wickremesinghe, who also heads the finance department and held several rounds of talks with the IMF team.