COLOMBO, Sri Lanka (AP) — Sri Lanka’s president acknowledged Monday that he made mistakes that led to the country’s worst economic crisis in decades and pledged to correct them.

President Gotabaya Rajapaksa made the admission while speaking to 17 new Cabinet ministers he appointed Monday as he and his powerful family seek to resolve a political crisis resulting from the country’s dire economic state.

Sri Lanka is on the brink of bankruptcy, with nearly $7 billion of its total $25 billion in foreign debt due for repayment this year. A severe shortage of foreign exchange means the country lacks money to buy imported goods.

People have endured months of shortages of essentials like food, cooking gas, fuel and medicine, lining up for hours to buy the very limited stocks available.

“During the last two and a half years we have had vast challenges. The COVID-19 pandemic, as well as the debt burden, and some mistakes on our part,” Rajapaksa said.

“They need to be rectified. We have to correct them and move forward. We need to regain the trust of the people.”

He said the government should have approached the International Monetary Fund early on for help in facing the impending debt crisis and should not have banned chemical fertilizer in an attempt to make Sri Lankan agriculture fully organic. Critics say the ban on imported fertilizer was aimed at conserving the country’s declining foreign exchange holdings and badly hurt farmers.

The government is also blamed for taking out large loans for infrastructure projects which have not brought in any money.

“Today, people are under immense pressure due to this economic crisis. I deeply regret this situation,” Rajapaksa said, adding that the pain, discomfort and anger displayed by people forced to wait in long lines to get essential items at high prices is justified.

The Cabinet appointments follow weeks of protests over shortages of fuel and food and demands that Rajapaksa, his politically powerful family and his government resign.

Much public anger has been directed at Rajapaksa and his elder brother, Prime Minister Mahinda Rajapaksa. They head an influential clan that has held power for most of the past two decades.

Thousands of protesters occupied the entrance to the president’s office for a 10th day on Monday.

The president and prime minister remain in office, but some other relatives lost their Cabinet seats in what was seen as an attempt to pacify the protesters without giving up the family’s hold on power.

Many senior politicians and those facing corruption allegations were excluded from the new Cabinet in line with calls for a younger administration, though the finance and foreign affairs ministers retained their positions to assist with an economic recovery.

Most of the Cabinet resigned on April 3 after protests erupted across the country and demonstrators stormed and vandalized the homes of some Cabinet ministers.

Opposition parties rejected an offer by President Rajapaksa to form a unity government with him and his brother remaining in power. Opposition parties have failed, meanwhile, to gain a parliamentary majority.

Last week, the government said it was suspending repayment of foreign loans pending talks with the International Monetary Fund. Finance Minister Ali Sabry and officials left for talks with the IMF on Sunday. The IMF and World Bank are holding annual meetings in Washington this week.

Sri Lanka has also turned to China and India for emergency loansto buy food and fuel.