The move begins the process of setting up a government of national unity, expected to be formed within days.
Under heavy guard, Riek Machar arrived in the South Sudanese capital of Juba where he was welcomed by supporters.
Government officials and diplomats from the United Nations peacekeeping mission in South Sudan were also among the crowd.
Mr Machar says he’s glad to be back.
“And I hope with my arrival and the rest of the leadership we will push the other obstacles and get rid of them and move forward to full implementation of the agreement.”
It’s been more than two years since Mr Machar fled the country at the start of the civil war in 2013.
He’d been accused of trying to instigate a coup, which he denied, but it set off a round of killings which escalated into a full-blown conflict.
His arrival from neighbouring Ethiopia was delayed by a week over negotiations on the number of troops he could bring, and what weapons they could carry.
Hours after arriving, Mr Machar took the oath as the country’s vice-president, sworn in by his arch-rival, President Salva Kiir.
Mr Machar has listed his main four priorities.
“Stabilization of security, stabilization of the economy, getting access of the humanitarian relief, and then the process of national reconciliation, so, I am happy to be here and you are welcome.”
President Salva Kiir says Mr Machar’s return marks the end of war and the return of peace and stability to the country.
He also offered a rare apology to the South Sudanese people and to the international community, for delays in implementing a peace agreement signed eight months ago.
“I repeat our apologies to the people of South Sudan for the situation that we the leaders have created and I ask you continue to endure with us. I also ask you to join me and my brother Riek Machar in the spirit of forgiveness and reconciliation. Our people are tired of war and they need peace now.”
UN official Herve Ladsous welcomed Mr Machar’s return as an integral part of bringing peace to South Sudan, but says the situation in the country remains worrying.
“The security situation in South Sudan remains precarious with intermittent fighting witnessed in several areas of the country. Of particular concern are the recent clashes between the SPLA and armed groups in Wau County in western Bahr el Ghazal, where is mostly SPLA against a group of young people, all these leading to killing and further displacement of the civilians.”
Tens of thousands have been killed and about two million people left homeless in fighting that has ravaged the world’s youngest nation, which became independent in 2011.
The conflict has also prompted the UN to set up an inquiry into possible human rights violations.
Herve Ladsous calls for the immediate formation of a transitional government to end the fighting, resettle millions of displaced and stabilise the country’s collapsing economy.
“The government continues to impose restrictions on the movement of UNMISS and of humanitarian workers in violation of the status of forces agreement. These restrictions, I am thinking in particular of those of night patrols in Juba have severely impacted the ability of the mission to move and to protect civilians as well as the ability of the United Nations to deliver the humanitarian assistance which is more than ever badly needed.”
Many South Sudanese hope Mr Machar’s return turns a new page for the country, but many worry it just returns the bitterly divided country to the pre-war status quo.
Mr Ladsous says the country cannot afford to remain divided.
“Dissent is not tolerated, free speech is penalized and despite the government claims to the contrary, there is a real and deliberate environment of intimidation. The South Sudan’s peace process is extremely fragile. It will require concerted, sustained efforts at every level – national, regional, international.”
Despite the delays, South Sudan’s government says it remains committed to fully implementing the peace deal.
South Sudan’s deputy representative to the UN, Joseph Malok, says the new transitional government will be formed in the next few days.
“The government of the Republic of South Sudan is firm in its commitment to fully implement the agreement. The swearing in of Dr. Riek Machar as first Vice President opens a new chapter of the implementation of the peace agreement.”
The transitional government will run the country for an interim period of thirty months until elections are held.