Thousands of South Sudanese danced through the night to mark the first hours of their independence on Saturday, a hard-won separation from the north that also plunged the fractured region into a new period of uncertainty.
The Republic of South Sudan, an under-developed oil producer, became the world's newest nation on the stroke of midnight.
It won its independence in a January referendum – the climax of a 2005 peace deal that ended decades of civil war with the north.
Security forces at first tried to control the dusty streets of the southern capital Juba, but retreated as jubilant crowds moved in waving flags, dancing and chanting "South Sudan o-yei, freedom o-yei."
After the sun came up, thousands poured onto the site of the day's independence ceremony – a possible headache for officials keen to guard dignitaries including the President of Sudan, the south's old civil war foe, Omar Hassan al-Bashir.
Years of war have flooded South Sudan with weapons.
In a possible sign of the South's new allegiances, the crowd included about 200 supporters of Darfur rebel leader Abdel Wahed al-Nur, whose forces are fighting Khartoum in an eight-year insurgency just over South Sudan's border in the north.
The supporters of Nur's rebel Sudan Liberation Army faction stood in a line chanting "Welcome, welcome new state," wearing T-shirts bearing their leader's image. One carried a banner reading "El Bashir is wanted dead or alive."
Traditional dance groups drummed and waved shields and staffs in a carnival atmosphere.
"I am very pleased," said Joma Cirilow, 47, his hand on his son's shoulder. "Do you want to be a second class citizen? No, I want to be a first class citizen in my own country."
Christian priests in full robes blessed the ceremony site in central Juba where a large statue stood draped in a flag near the mausoleum of the south's civil war hero John Garang.
"Today we raise the flag of South Sudan to join the nations of the world. A day of victory and celebration," Pagan Amum, the secretary general of the South's ruling Sudan People's Liberation Movement (SPLM) told Reuters.
"Free at last," said Simon Agany, 34, as he walked around shaking hands. "Coming away from the north is total freedom."
North Sudan's Khartoum government was the first to recognize the new state on Friday, hours before the formal split took place, a move that smoothed the way to the division of what was, until Saturday, Africa's largest country.
The recognition did not dispel fears of future tensions.
Northern and southern leaders have still not agreed on a list of issues, most importantly the line of the border and how they will handle oil revenues, the lifeblood of both economies.
At the stroke of midnight the Republic of Sudan lost around three quarters of its oil reserves, which are sited in the south, and faced the future with insurgencies in its Darfur and Southern Kordofan regions.
In Khartoum, just before the split, Bashir, who now leads just the north, told journalists he would attend the independence celebrations later in the day in Juba.
"I would like to stress … our 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," said Bashir.
Bashir's presence at the ceremony, while a signal of the north's goodwill, will be an embarrassment to some Western diplomats. The International Criminal Court has issued an arrest warrant for Bashir, on charges of war crimes in Darfur.
Analysts have long feared a return to war if north/south disputes are not resolved.
UN Secretary General Ban Ki-moon told reporters in Juba on Friday South Sudan would soon join the global body.
"South Sudan begins life as a state facing enormous challenges. But South Sudan has remarkable potential with natural resources, huge amounts of arable land and the waters of the White Nile flowing through it," he said.
The United Nations Security Council voted on Friday to establish a force of up to 7,000 peacekeepers for South Sudan.
Earlier in Khartoum, Ban urged the northern government to allow U.N. peacekeepers to stay beyond the end of their mandate to monitor the situation in Southern Kordofan, the north's biggest remaining oil producing state, and other hotspots.
The mandate of UNMIS, which has deployed 10,000 peacekeepers in Sudan and was set up to monitor the 2005 peace deal, expires on Saturday.
Mostly Muslim Sudan and South Sudan, where most follow Christianity and traditional beliefs, fought each other for all but a few years since the 1950s in civil wars fueled by ethnicity, religion, oil and ideology.
That fighting killed an estimated 2 million people and forced 4 million to flee. It also destabilized the region which includes some of east Africa's most promising economies including Kenya, Uganda and Ethiopia.