JUBA, South Sudan – South Sudan has agreed to the deployment of a 4,000-strong regional protection force approved by the U.N. Security Council after first rejecting the peacekeepers as a violation of its sovereignty.

Sunday’s announcement came after the Security Council met with South Sudan President Salva Kiir during a rare visit to the turbulent East African country.

ChangSha Night Net

The threat of an arms embargo loomed over the meeting, as the council has said it would pursue one if South Sudan didn’t accept the additional peacekeepers. The U.N. already has 12,000 peacekeepers in the country, and South Sudan has been wary of giving it more authority.

READ MORE: Canada to send more peacekeepers overseas, here’s where they could go

Protecting civilians has become an even more critical issue after fighting erupted in the capital, Juba, in July, killing hundreds and sparking fears of a return to civil war in the already devastated country.

Both civilians and foreigners, including aid workers, were targeted in the July chaos by South Sudanese soldiers who raped women and girls, conducted mock executions and forced people at one hotel compound to watch a local journalist be shot dead.

Challenges already lie ahead for the 4,000 additional peacekeepers, who are tasked with protecting civilians in Juba and perhaps beyond. U.N. officials say the new force needs more than two months to deploy.

READ MORE: South Sudan rebel leader reportedly flees country

And Senegal’s ambassador to the U.N., Fode Seck, said there has been difficulty getting enough troops pledged by regional countries that will make up the force.

South Sudan also has committed to implementing a hybrid court to investigate war crimes, according to Sunday’s joint statement by the government and the Security Council.

Both government and rebel forces have been accused of widespread abuses in the civil war that began in December 2013 between supporters of Kiir and former Vice-President Riek Machar. Tens of thousands of people have died.