UNITED NATIONS — The U.N. Security Council narrowly approved a U.S.-drafted resolution imposing an arms embargo on South Sudan Friday over objections that it could hurt African efforts to end the five-year conflict in the world's newest nation.

The resolution received the minimum nine "yes" votes. The six other council members abstained — Russia, China, Ethiopia, Equatorial Guinea, Kazakhstan and Bolivia.

In addition to an immediate arms embargo, the resolution imposes a travel ban and asset freeze on South Sudan's deputy defense chief for logistics, Malek Reuben Riak Rengu, and former chief of the Sudan People's Liberation Army, Paul Malong Awan.

There were high hopes that South Sudan would have peace and stability after its independence from neighboring Sudan in 2011. But it plunged into ethnic violence in December 2013 when forces loyal to President Salva Kiir, a Dinka, started battling those loyal to Riek Machar, his former vice president who is a Nuer.

A peace deal signed in August 2015 didn't stop the fighting, and neither did cessation of hostilities agreement this past December and a declaration on June 27.

The conflict has killed tens of thousands of people and forced over 4 million to flee their homes, more than 1.8 million of them leaving the country in what has become one of the world's fastest-growing refugee crisis.

The United States tried unsuccessfully in 2016 to impose an arms embargo on South Sudan.

U.S. Ambassador Nikki Haley told the council before the vote that since then "we can only imagine how many weapons made their way to the parties" and were used "to shoot fathers in front of their wives and children, to hold up convoys of food aid, or to assault women and girls."

"To stop the violence, we need to stop the flow of weapons that armed groups are using to fight each other and to terrorize the people," she said. "The arms embargo is a measure to protect civilians and help stop the violence. For negotiations to work, we must end the cycle of broken promises to stick to a cease-fire."

Ethiopia's U.N. Ambassador Tekeda Alemu strongly opposed the arms embargo telling the council that the High-Level Revitalization Forum organized by the regional group IGAD to try to restore peace "has made notable progress, and for the first time in a long time there is some hope for a possible breakthrough."

He said the opposing parties have reached an agreement on security arrangements and reports from Sudan's capital, Khartoum, where talks are taking place, "are indicating they are closer than they have ever been to reach an agreement on governance issues."

"The decision you are going to make today would have very serious implications for the peace process," Alemu warned, and that's why IGAD and the African Union were oppose an arms embargo and are asking for patience.

South Sudan's U.N. Ambassador Akuei Bona Malwal said after the vote that the resolution "is a slap in the face" of the organizations trying to bring peace to the country.

"To pass a resolution at a time when the peace process is making advances, positive advances, this will turn the balance for those parties that are negotiating," he said. "The opposition will think the Security Council is on their side, so why should they really continue to negotiate? That's why this resolution is unfortunate."

But John Prendergast, founding director of the Enough Project which supports an end to mass atrocities in Africa, said: "The Security Council delivered a small dose of accountability and leverage today in support of peace. It's not sufficient, but without this as a first step, peace has no chance in South Sudan."

The Security Council adopted a resolution on May 31 threatening an arms embargo on South Sudan and sanctions against six people if U.N. Secretary-General Antonio Guterres reported by June 30 that fighting didn't stop and a political agreement wasn't reached.

Guterres said in a June 29 letter to the council that "there have been credible reports of fighting" and U.N. peacekeepers had documented serious violations of international human rights and humanitarian law

A U.N. report released Tuesday said South Sudan government troops and allied fighters killed at least 232 civilians in a five-week period this year, hanging some people from trees and burning others alive. It says the "deliberate, ruthless" attacks may amount to war crimes.

Haley, the U.S. ambassador, told the council "this is barbaric," stressing that the violence was just in one state and took place after the parties had signed the December cease-fire.

The resolution orders all countries to immediately prevent the direct or indirect supply or sale of weapons, ammunition, military vehicles and other equipment and spare parts to South Sudan until May 31, 2019. It also renews existing sanctions against South Sudanese officials until that date.

The resolution underscores that arms shipments "risk fueling conflict and contributing to further instability and strongly urges all member states to take urgent action to identify and prevent such shipments within their territory."