Sudan became the first state to recognize the independence of its oil-producing south on Friday, smoothing the way for the division on Saturday of Africa's largest country into two but not dispelling fears of future tensions between them.
Underdeveloped South Sudan is to secede after midnight – a hard-won separation that comes as the climax of an internationally brokered 2005 peace deal that ended decades of north-south civil war.
"The Republic of Sudan declares that it recognizes the state of South Sudan from July 9," Khartoum's Minister for Presidential Affairs Bakri Hassan Saleh announced on state television.
Sudan entered its last day as a united nation with rumblings of conflict along its north-south border and international concerns for the future stability of the huge, fractured and largely impoverished territory that straddles Arab and sub-Saharan Africa.
But looming independence already sparked celebrations across the south – and in large diaspora southern communities from the United States to Australia – with many seeing it as a moment of liberation after years of fighting and perceived repression, dating back to raids by Arab slave traders.
Dancers decked in South Sudanese flags and leopard-print trousers marched through the streets of the ramshackle southern capital Juba on Friday, counting down the hours until Sudan split into two states.
"I'm very happy for the independence," said Gabriel Yaac, 38, in central Juba.
"There is nothing bad in the future. If you are alone in your house you can manage your own things. No one will interrupt you."
The new Republic of South Sudan will take around 75 per cent of the country's known oil reserves with it when it goes, depriving the Khartoum government of more than a third of its national revenues, the northern finance minister said last month.
Police and soldiers in Juba tried to keep a lid on the more boisterous revelers – banning celebratory gunfire, seizing weapons and searching cars – determined to protect the scores of dignitaries flowing into a city awash with small arms.
A red digital display on a city roundabout counted down the seconds to independence. "Free at last," one message on the display board flashed.
In sharp contrast, the streets were largely empty in the northern capital Khartoum on Friday, the start of the weekend in the Muslim north.
"Losing the south will be difficult for a few years after losing the oil," minibus driver Osman said. "But all we've had up to now is war. It is good we are going our separate ways."
Other northerners see the separation as a tragedy, robbing Sudan of around a third of its territory and ending a dream of a diverse nation containing a vast patchwork of the continent's cultures.
"This overwhelming of sorrow, of sadness is wrapping around us. I cannot put my feelings into words. It is beyond expression. I am in a vacuum. I want to go into hibernation," the spokeswoman for the opposition UMMA party Mariam al-Mahdi told Reuters.
North and south leaders have still not agreed on how they will manage oil revenues, the lifeblood of both their economies. Other critical issues, including the ownership of the disputed Abyei region after the split, have alarmed diplomats who fear they will return to war.
North Sudan has the only pipelines in the country, and has threatened to block them if the south does not pay enough. Southern officials on Friday said they would be able to live off credit, using their oil reserves as collateral, if the north carried out its threat.
Sudan's President Omar Hassan al-Bashir, who will lead the north after the split, on Thursday said he would fly to Juba for the independence celebrations and promised friendly relations.
But he sent out a stern message to rebel movements in the north, saying he would not take part in any more international peace talks with armed groups. Khartoum is fighting rebels in the Darfur region and, since early June, in its main remaining oil state Southern Kordofan. Both regions border the south.
Analysts have accused Khartoum of targeting civilians from the ethnic Nuba group in Kordofan -- many of whom fought alongside south in the civil war with a military ground and air campaign. Khartoum denies the accusation.
U.N. Secretary General Ban Ki-moon on Friday urged Sudan to change its mind and allow peacekeepers to stay in the strife-torn Southern Kordofan region and other areas, a day ahead of the end of their mandate.
Khartoum has said it wants the blue helmets, deployed to monitor the 2005 peace deal, to go.
"I have urged the Government of Sudan for technical and practical reasons for an extension of the mandate of the United Nations in Sudan, at least until the situation (in Southern Kordofan) calms down. We can not afford to have any gaps," Mr. Ban told journalists in Khartoum.
South Sudan will start life as one of the least developed nations on earth, despite its oil revenues.
Aid group Medecins Sans Frontieres or said the south was going through a humanitarian emergency with existing poverty compounded by disease outbreaks, tribal and rebel clashes -- and the return of around 300,000 southerners ahead of the independence, many of them needing aid.
With files from Khaled Abdelaziz and Ulf Laessing in Khartoum and Jeremy Clarke in Juba