In a move fraught with risk, the United States and other world powers said Monday they would supply Libya’s internationally recognized government with weapons to counter the Islamic State and other militant groups gaining footholds in the chaos-wracked country’s lawless regions.

Aiming at once to shore up the fragile government, and prevent Islamic State fighters and rival militias from further gains, the U.S., the four other permanent U.N. Security Council members and more than 15 other nations said they would approve exemptions to a United Nations arms embargo to allow military sales and aid to Libya’s so-called “Government of National Accord.”

In a joint communique, the nations said that while the broader embargo will remain in place, they are “ready to respond to the Libyan government’s requests for training and equipping” government forces.

“We will fully support these efforts while continuing to reinforce the UN arms embargo,” the communique said.