Darfur rebels fought Sudanese troops in a suburb of Khartoum on Saturday in a bid to seize power, but the government said the attack was defeated.
It was the first time fighting had reached the city in decades of conflict between the traditionally Arab-dominated central government of Africa's biggest country and rebels from peripheral regions.
Heavy gunfire and artillery shook Omdurman, across the Nile from the heart of Khartoum. Helicopters and armoured vehicles headed for the fighting and an overnight curfew was declared.
"The main aim of this failed terrorist sabotage attack was to provoke media coverage and let people imagine that they had the ability to enter Khartoum," Mandour al-Mahdi, political secretary of the ruling National Congress Party, told state television.
"Thank God this attempt has been completely defeated. Some high level JEM commanders were killed," he said, referring to the Darfur Justice and Equality Movement (JEM) rebels.
Sudan accused neighbouring Chad of backing the rebels, who made a lightning advance across some 600 km (400 miles) of desert and scrub between Darfur and Khartoum. A top official said the attack destroyed any chance of peace talks.
Chad's government denied involvement, condemning it as an "adventure". The United States and the office of UN Secretary General Ban Ki-Moon called for an immediate end to fighting.
Sudanese state television showed corpses, blood and burned vehicles in the streets. It displayed what it said were rebel prisoners, including two who confessed to the camera. One looked badly beaten.
Witnesses said gunfire continued in Omdurman's western outskirts.
The rebels dismissed the government version of events and said fighting was still going on in their attempt to oust President Omar Hassan al-Bashir.
"We are in Omdurman, we are in Khartoum north. This is not something that is going to be finished in a few hours," JEM official al-Tahir al-Faki told Reuters from Britain. "There is an imbalance of power and wealth, we have to sort this out."
US-based Sudan expert Alex De Waal called the move "very serious indeed".
"There's whole bunch of other JEM forces out there and JEM are saying there are other reinforcements arriving," he said. "It's not over yet."
Khartoum state is home to around 8 million of the 38 million people in a country bigger than Western Europe.
Sudan's economy, driven by increasing oil production, has grown rapidly since a peace deal between north and south ended one civil war in 2005, but that agreement did not cover the conflict that erupted in Darfur five years ago.
International experts estimate some 200,000 people have died and 2.5 million been made homeless in Darfur since mostly non-Arab rebels took up arms.
The United States describes the conflict in Darfur as genocide, but Khartoum rejects that term and says only around 10,000 people have been killed. Sudan is a close ally of China, a big oil industry investor and its main arms supplier.
Western countries, pushing for peace talks, have accused Khartoum of dragging its feet over deployment of a 26,000-strong UN-African Union peacekeeping force in Darfur. Fighting has intensified there in recent months.
Talks ruled out
Presidential adviser Mustafa Osman Ismail ruled out any chance of peace talks with JEM after the attack on Khartoum.
"From this day we will never deal with this movement again other than in the way they have just dealt with us," he said on Al-Jazeera television.
Sudanese officials accused neighbouring Chad of backing Saturday's rebel attack. Chad in turn says Khartoum is behind rebels who came close to seizing power there in February. Each country denies supporting the other's rebels.
"This was fully supported by the Chad government," presidential adviser Ghazi Salaheddin told Reuters. "There are indications that another contingent in on its way from Chad. Personally I doubt they will try this again after what has happened here."
Chad denied the "baseless" accusations, an official at the presidency said.
"The Chadian government is surprised by allegations by Sudanese television of N'Djamena's supposed support for the attackers," Communications Minister and government spokesman Mahamat Hissene said in a statement released in N'Djamena.
"The government of the Republic of Chad denies any involvement in this adventure, which it condemns unreservedly, whoever the authors are."
Chad and Sudan signed a non-aggression pact in mid-March but accused each other of reneging on the deal soon afterwards.
There were signs that Egypt was showing support for Khartoum on Saturday. A witness said he saw three Egyptian fighter planes and one Egyptian army cargo plane land at the airport.