South Sudan's President Salva Kiir has signed a peace deal with rebels after a threat of sanctions from the UN.
He told those gathered for the signing ceremony in the capital, Juba, that he had "reservations" about how the mediation was conducted and some of the clauses in the compromise deal.
Rebel leader Riek Machar signed the deal last week but Mr Kiir refused.
It is meant to end months of brutal civil war and will see Mr Machar return as vice-president.
Fighting between forces loyal to the two men over the last 20 months has forced more than 2.2 million people from their homes in the world's youngest state, which broke away from Sudan in 2011.
The United States welcomed the agreement but said that it did not "recognise any reservations" that President Kiir had highlighted at the signing ceremony.
In a statement, the US National Security Advisor Susan Rice said that reaching a lasting peace would "require commitment and resolve from all parties to the conflict".
The leaders of Kenya, Uganda and Ethiopia, who all helped mediate the negotiations, witnessed the signing.
One of the two generals who defected earlier this month from the rebel side has condemned the peace deal, saying it is "not for the whole of South Sudan".
"If they don't listen to us, they'll listen to the bullets," General Gathoth Gatkuoth told the BBC, referring to both the government and the rebels.