Hassan al-Turabi fell out with President Bashir in the 1990s
Sudan's Islamist leader Hassan al-Turabi has been freed from custody hours after being arrested.
He was detained following a rebel raid near Khartoum at the weekend. The authorities accused him of having links to the rebels, his wife told the BBC.
Mr Turabi has denied such claims in the past, although some Darfur rebel leaders have followed him.
The authorities are continuing to hunt for suspected rebels following the surprise attack.
The raid by the Justice and Equality Movement (Jem) on Omdurman, Khartoum's twin city, across the River Nile, was the closest they had come to the capital in five years of conflict in Darfur.
A curfew was reimposed in Omdurman on Monday and the atmosphere remains tense, the BBC's Amber Henshaw in Khartoum says.
Sudan has blamed the attack on neighbouring Chad, which has denied any links, as has Jem.
The government says it has repulsed the attack but Jem leader Khalil Ibrahim says the rebels will be back.
"This is just the start of a process and the end is the termination of this regime," he told Reuters news agency.
Mr Ibrahim used to follow Mr Turabi and correspondents say they share an Islamist outlook.
Mr Turabi was Sudan's main ideologue in the 1990s before falling out with President Omar al-Bashir. He has since been imprisoned several times.
He was interrogated for several hours by the security forces over the attack.
Our correspondent says it appears that he has not been charged.
Sudan's ambassador to the UN, Abdalmahmood Abdalhaleem, told the BBC that captured rebels had identified Chadian officers killed during the assault.
Sudan has severed diplomatic ties with Chad, which in turn closed its border to Sudan on Monday.
Experts say Chad and Sudan are fighting a proxy war using each other's rebels to achieve their military objectives.
Earlier this year, rebels reached Chad's capital N'Djamena, with Chad accusing Sudan of involvement.