UKUNDA, Kenya — Under intense pressure, South Sudan’s beleaguered government has relented and will allow more United Nations peacekeepers into the country.

In the two and a half years since civil war erupted, South Sudan has been the scene of atrocities including civilian massacres, the forcing of children into militias, the burning of emergency food supplies and the widespread rape of women and girls, including Western aid workers. Tens of thousands of people have been killed.

On Sunday night, during a visit by the United Nations Security Council to Juba, South Sudan’s capital, the government agreed to allow the addition of 4,000 peacekeeping troops to the existing force of 14,000 soldiers, police and military observers. Top American officials, including Secretary of State John Kerry and Samantha Power, ambassador to the United Nations, had been pushing hard for the increase and the Security Council authorized the expansion of the force last month.

African nations had also supported the move, though South Sudan’s government had claimed that it would be an affront to its sovereignty.