UNITED NATIONS (Reuters) - The United Nations Security Council imposed an arms embargo on South Sudan on Friday, nearly five years after civil war erupted in the country.

A U.S.-drafted resolution won the minimum nine votes needed, while Russia, China, Ethiopia, Bolivia, Equatorial Guinea and Kazakhstan abstained, wary of voting for the measure amid regional attempts to revitalize the South Sudan peace process.

Western states and top U.N. officials have long called for an arms embargo on South Sudan. A U.S. bid to impose the measure in December 2016 - under the previous U.S. administration of President Barack Obama - failed to get enough votes in favor.

“South Sudan’s people have endured unimaginable suffering and unspeakable atrocities. Their leaders have failed them,” U.S. Ambassador to the United Nations Nikki Haley told the council before the vote. “We need the violence to stop.”

South Sudan, which split from its northern neighbor Sudan in 2011, has been gripped by a civil war since 2013 sparked by a political rivalry between President Salva Kiir and his former deputy Riek Machar. The war has been marked by U.N. accusations of atrocities by all sides and fears of possible genocide.

U.N. peacekeepers have been deployed since South Sudan’s independence in 2011. Last Friday the government and opposition signed a deal on security arrangements which follows on from a truce last month.

Ethiopia’s U.N. Ambassador Tekeda Alemu told the council before the vote that imposing the arms embargo would undermine the peace process and that the African Union and East African regional bloc IGAD believe “now is not the appropriate time for taking such measures.”

China’s U.N. Ambassador Ma Zhaoxu said the Security Council should have listened to African leaders on the issue.

South Sudan’s U.N. Ambassador Akuei Bona Malwal told the council the resolution would “undermine peace” and was “a slap in the face of those organizations who are trying to bring peace in South Sudan.”

However, on Thursday South Sudan’s parliament voted to extend Kiir’s mandate until 2021 in a move likely to undermine the peace talks as opposition groups have said the change would be illegal.

Britain’s U.N. Ambassador Karen Pierce said after the council vote: “It’s not a resolution about the peace process. It’s a resolution designed to protect the people of South Sudan ... We expect the peace process to continue.”