South Sudan President Salva Kiir and rebel leader Riek Machar agreed on Thursday to form a unity government, a long-delayed step towards ending six years of war that has killed hundreds of thousands of people.

Kiir said the new government will be formed on Saturday and he will appoint Machar as his first vice president, or top deputy, on Friday.

The president said security arrangements, one crucial issue, will be resolved after the government's formation. He said the protection of Machar and others with the opposition will be under his responsibility.

More:

"We have agreed to form the government in two days on 22nd February. We are still discussing other things and I am hopeful we will resolve them all," Machar said after a meeting between the two.

South Sudan's civil war broke out just two years after mass celebrations after gaining hard-fought independence from Sudan. The conflict badly hurt the oil-rich nation's economy, and roughly half the country's 12 million people are hungry today.

Divided over states

Major challenges in the peace process remain, including the delicate process of integrating tens of thousands of former rival forces into a united army.

Widespread abuses such as the recruitment of child soldiers and sexual violence continue, a new report by the UN Commission on Human Rights on South Sudan said Thursday.

Machar rejected a peace offer on Sunday by Kiir, which included plans to reduce the number of states in the country, but also create three administrative areas.

The rejection by Machar, announced in a statement, dashed hopes of breaking a deadlock and ending the conflict that has killed at least 380,000 people and left millions in dire poverty.

Kiir and Machar - who lives in exile - are under increasing international pressure to resolve their differences by a February 22 deadline.

Kiir said this week the country would now be divided into the original 10 states - a key opposition demand - plus three "administrative areas" of Pibor, Ruweng and Abyei.

While Machar said he appreciated the government's decision to "revert to 10 states", he expressed his dissatisfaction with the creation of the three administrative zones.

Machar warned the three areas risked causing further problems, calling the issue a "Pandora's box".

The number of states is contentious because the borders will determine the divisions of power in the country.

When it gained independence from Sudan in 2011, South Sudan had 10 states, as set out in its constitution. Kiir increased that in 2015 to 28, then later 32.

The president said the final matter of states would be debated once the unity government is formed.

Of the three proposed areas, the most contentious is thought to be oil-rich Ruweng in the north. Oil provides almost all of the government's revenue in South Sudan, making it one of the world's most oil-dependent nations.

Ruweng has been one of the most heavily fought-over areas in the civil war and is claimed by both the Dinka people, of whom Kiir belongs, and the Nuer, Machar's ethnic group.