South Sudan's flag raised at independence ceremony
Please turn on JavaScript. Media requires JavaScript to play.
Tens of thousands of South Sudanese have watched the raising of the country's new flag at an independence ceremony in the capital, Juba.
Sudan's President Omar al-Bashir and UN chief Ban Ki-moon are among dignitaries who came for the event.
South Sudan became the world's newest nation at midnight, the climax of a process made possible by the 2005 peace deal that ended a long civil war.
Sudan earlier became the first state to officially recognise its new neighbour.
The south's independence follows decades of conflict with the north in which some 1.5 million people died.
Excitement and relief
Celebrations in Juba began at midnight (2100 GMT). A countdown clock in the city centre reached zero and the new national anthem was played on television.
South Sudan became the 193rd country recognised by the UN and the 54th UN member state in Africa.
Continue reading the main story At the scene Officials had planned for people to hold quiet celebrations at home, with the formal declaration of independence due later on Saturday. But the people clearly couldn't wait. Two hours before midnight and lines of cars zoomed around town packed with people waving flags and waiting to celebrate. When the final countdown arrived, the atmosphere was wild. Groups ran down roads, dancing to drum beats. Soldiers and policemen joined in too, waving paper flags and laughing. A sign read: "Congratulations, free at last, South Sudan." But the people didn't need to read the message - they were already dancing and leaping with happiness. "It is a shout of freedom," said Alfred Tut, lifting his head back and screaming.
The BBC's Will Ross in Juba says the new country's problems were put aside for the night amid an air of great jubilation.
People were in the streets cheering, waving South Sudan flags, banging drums and chanting the name of President Salva Kiir Mayardit, he adds.
On Saturday, a formal independence ceremony was held at the mausoleum of the late rebel leader John Garang, who died just months after signing the peace deal that ended Africa's longest-running conflict.
Our correspondent says South Sudanese have flocked to the event on a baking hot day - some of them are even climbing trees to get a view of what is going on.
There is celebratory mood and there is a heartfelt display of excitement mixed with relief that after so many years of feeling oppressed the tie with the north has finally been cut, he says.
The Speaker of the South Sudan Legislative Assembly, James Wani Igga, read out the Proclamation of the Independence of South Sudan.
Afterwards, crowds cheered as Sudan's national flag was lowered and the new flag of South Sudan was raised.
'Southern brothers'
Earlier, Mr Bashir arrived at Juba airport where he was greeted by Mr Kiir.
Other attendees include former US Secretary of State Colin Powell, the US permanent representative to the UN, Susan Rice, and the head of the US military's Africa Command, Gen Carter Ham.
Under the Comprehensive Peace Agreement, a referendum was held on independence, which was approved by more than 99% of voters.
The new country is rich in oil, but one of the least developed countries in the world, where one in seven children dies before the age of five.
Unresolved disputes between the north and south, particularly over the new border, have also raised the possibility of renewed conflict.
Continue reading the main story South Sudan Facts and figures: Population: 7.5-9.7 million
Size: 619,745 sq km (239,285 sq miles), larger than Spain and Portugal combined
Major languages: English, Arabic (both official), Juba Arabic, Dinka
Religion: Traditional and a Christian minority
Main export: Oil Challenges ahead: One of world's least developed countries: Worst maternal mortality rate; most children below 13 not in school; 84% of women are illiterate
Relations with Sudan: Dividing debts and oil; border disputes; citizenship
Security: At least seven active rebel groups
President Bashir, who agreed the 2005 peace deal with the Sudan People's Liberation Army (SPLA), stressed his country's "readiness to work with our southern brothers and help them set up their state so that, God willing, this state will be stable and develop".
"The co-operation between us will be excellent, particularly when it comes to marking and preserving the border so there is a movement of citizens and goods via this border," he told journalists in Khartoum.
Fears of fresh conflict resurfaced after recent fighting in two border areas, Abyei and South Kordofan, which forced some 170,000 people from their homes.
But separate deals - and the withdrawal of rival forces from the border - have calmed tensions.
The UN Security Council has passed a resolution approving a new 7,000-strong peacekeeping force for South Sudan - but this is basically a rebranding of the force which was already in Sudan, mostly in the south.
Khartoum has said its mandate would not be renewed, leading the US to argue that the 1,000 UN troops should be allowed to remain in South Kordofan. The 1,000 troops in the disputed town of Abyei are to be replaced by 4,200 Ethiopian soldiers.
Our correspondent says keeping both the north and the south stable long after the celebratory parties have ended will be a mighty challenge.
Please turn on JavaScript. Media requires JavaScript to play.
The two sides must still decide on issues such as drawing up the new border and how to divide Sudan's debts and oil wealth.
Analysts say the priority for Khartoum will be to negotiate a favourable deal on oil revenue, as most oilfields lie in the south. At present, the revenues are being shared equally.
Khartoum has some leverage, as most of the oil pipelines flow north to Port Sudan on the Red Sea.
Citizenship is also a key issue which has not yet been decided.
A new law passed by the National Assembly in Khartoum has withdrawn Sudanese citizenship from all southerners.
The UN refugee agency (UNCHR), has urged both governments to prevent statelessness.
Sudan: A country divided
At 0000  Saturday (2100  Friday), the Republic of South Sudan achieved independent recognition, becoming the newest country on the planet. The parliament speaker for the new country recited a formal independence declaration. After independence was declared, the South Sudanese flag was lifted for all to see, with  secretary general Pagan Amum stating: "Today we shall raise the flag of South Sudan to join the nations of the world". 

Thousands of jubilant people celebrated in the new country's capital Juba. They danced in the streets, sang songs and waved flags.  Churches rang their bells at midnight as independence arrived. People crowded to the official ceremonial site, held at the  of  , leader of the rebellion who died several months after the peace deal was signed with Sudan, ending the bloody conflict. Many of the celebrants spoke emotionally of their family members who died in the long struggle with Sudan.

George Garang, an English teacher, said he lost his father, grandfather and eleven brothers. "My whole body feels happy," he said. Valentino Achak Deng, who was a refugee during the war, said: "Really in my heart what makes me happiest is that from today, when people ask me where I am from, I do not have to say Sudan."

 has assumed the role as president of South Sudan. Kiir swore to pledge true alliance and faithfulness to South Sudan. In a speech, Kiir declared amnesty for any who have taken up arms against Sudan.

Kiir insisted that martyrs for the cause of the new country did not die in vain, although South Sudan waited 56 years to be free. The southern Sudanese had agitated for more rights, even before Sudan became free from its British colonizers in 1956. Sudan was divided into three separate demographic groups, with the southern part of the country home to Christians and animists and the northern part dominated by Arab populations and those of Muslim faith. Kiir said to people of , Darfur,  and , who remain part of Sudan, that "we have not forgotten you. When you cry, we cry. When you bleed, we bleed. I pledge to you today that we will find a just peace for all."

Amongst those attending the event were Ban Ki-moon, the current  and , the current president of Sudan. The latter was the guest of honour, despite the fact that the  has a warrant out for his arrest based on offences of  and  in the Darfur region.

"We congratulate our brothers in the south for the establishment of their new state," al-Bashir said at the event. "We share their joy and celebration. The will of the people of the south has to be respected."

Two million individuals died in the  between the two territories of Sudan and Southern Sudan and four million more exiled,  a war that was waged for decades. Control of south Sudan's oil rich reserves was the primary reason for the fighting. An  was signed in  2005, effectively bringing the war to an end, and Sudan became one of the first countries to recognise South Sudan. Under the regulations of the Comprehensive Peace Agreement, Sudan held an independence referendum. In excess of 99% of those participating in the vote agreed to the concept of independence for South Sudan. 

Meanwhile, the United Nations plans to make the independent state its 193rd recognised country and its 54th African U.N. member state. United States president Barack Obama formerly recognized the new nation on behalf of the US and acknowledged the enormous struggle of its people to achieve independence.

South Sudan remains a desperately poor country, with one in five of its inhabitants chronically hungry, only one third  having access to safe drinking water and with the world's highest rate of maternal death. The country lacks infrastructure such as roads and railways. It remains  torn by ethnic and tribal rivalries and many problems with the north remain unresolved, including the exact boundary line.  Important revenue for Sudan has come from the rich oilfields of the south, keeping the country afloat and essential now for both economies. A formula remains to be developed on how to split these revenues between the two areas.

U.S. ambassador to the U.N.  said today that the peace process between Sudan and North Sudan could come apart if issues  such as the division of the oil revenues and the border location are not solved soon.