South Sudan rebel leader Riek Machar.

South Sudan rebel leader Riek Machar arrived in the capital Juba Wednesday to take part in a peace ceremony two years after he fled the country.

Machar's return to the troubled country comes after the rebels and government signed a peace deal in September to end five years of brutal civil war.

South Sudan - the world's newest country - descended into chaos in 2013 after President Salva Kiir accused Machar, then his deputy, of plotting a coup. Machar fled Juba on foot to neighbouring Congo in July 2016.

Machar arrived at the airport Wednesday flanked by members of his SPLM group, and was met by government officials.

Thousands of people lined the streets of Juba in celebration, with revellers dancing and singing about peace. There was high security in the city however, with heavily armed troops deployed and military planes flying overhead.

Machar and his people will now attend a peace ceremony with the government where are expected to give speeches.

September's peace deal allows for the creation of a transitional government, with Machar to be reinstated as vice president.

However many international observers were skeptical after its inking and Machar’s party had previously expressed reservations on some points of the deal.

Previous agreements have collapsed after warring parties failed to respect them and numerous ceasefires have been broken.

The war has left tens of thousands of people dead, and about 4 million South Sudanese have fled the fighting. Rights groups have reported gross human rights violations on both sides.