After nearly five years of war, mayhem, widespread hunger and recurring atrocities including mass rapes in South Sudan, the United Nations Security Council took the extraordinary step Friday of imposing an arms embargo on the African country, the world’s youngest.A resolution proposed by the United States, which has been advocating an arms embargo against South Sudan for two years, was adopted by a 9-to-0 vote in the 15-member council. Six members abstained, reflecting what diplomats called concerns that the step might impede efforts by other African nations to revive South Sudan peace negotiations.But Nikki R. Haley, the American ambassador to the United Nations, who has made ending South Sudan’s civil war one of her signature causes since she visited the country last year, said an arms embargo would send an unmistakable message to its warring antagonists.“South Sudan’s people have endured unimaginable suffering and unspeakable atrocities,” Ms. Haley said ahead of the vote. “Their leaders have failed them. They are desperate to get the most basic food, medicine, and shelter. But above all, they just want the violence to stop.”Ms. Haley said for that to happen, “we need to stop the flow of weapons to armed groups, that they are using to fight each other and to terrorize the people.”The strongest objection came from South Sudan’s United Nations ambassador, Akuei Bona Malwal, who is not a council member but was invited to attend the vote. He urged council members to reject the arms embargo, calling it “a slap in the face of those organizations who are trying to bring peace in South Sudan.”Human rights groups, who often stand on opposite sides with Ms. Haley on issues like the Israeli-Palestinian conflict and migrant rights, welcomed the resolution.“South Sudanese civilians have been offered a glimpse of hope today,” said Akshaya Kumar, the deputy United Nations director at Human Rights Watch. “After years of threats but no action, the U.N. Security Council has finally prohibited the sale of weapons to South Sudan, where fighters have been using them to kill and assault civilians.”Under the resolution, all states are barred from providing weapons to South Sudan until May 2019, reflecting the “deep concern at the failures of South Sudan’s leaders to bring an end to the hostilities.”The resolution was adopted just a few days after South Sudan’s opposition forces rejected the latest proposal for peace, contained in a highly publicized agreement signed less than a month ago.It also followed the publication of a United Nations report documenting how government troops and allied militias went on an unbridled killing spree in the northern part of the country this spring, shooting fleeing civilians, hanging villagers from trees and gang-raping women and girls.The 17-page report, by the United Nations peacekeeping mission in South Sudan and the organization’s human rights office in Geneva, said at least 232 people were killed in that campaign and at least 120 women and girls, including children as young as four, were gang-raped.South Sudan has descended into a worsening cycle of violence since the civil war erupted in 2013 between its Dinka ethnic majority, led by President Salva Kiir, and the Nuer minority aligned with his former vice president, Riek Machar. Tensions leading up to the war began soon after the country gained independence from Sudan in 2011.Millions in the country are on the brink of famine, more than 2.5 million have fled to neighboring countries and hundreds of thousands are internally displaced, many sheltering in camps administered by the United Nations.President Kiir, whose term of office was supposed to end this year, may have hindered prospects for peace negotiations with Mr. Machar when the country’s Parliament voted this week to allow the president to remain in power until 2021. The opposition denounced the move.