"The court issued judgments on 23 people for between five to 15 years," said the country's Attorney-General Muhammad Farid. He later added one other person was sentenced in absentia.
He said two-thirds of the accused were from Hassan al-Turabi's opposition Popular Congress Party (PCP).
One was a policeman, two were retired police and security officials and the rest were from the army, Farid said.
The 24 were convicted of violating the constitution and waging war on the state, charges for which the maximum punishment is death. Most were given a 10-year sentence.
No charges yet
Turabi is still in jail held under emergency law but no charges have been brought against him. He was arrested after the March 2004 coup attempt.
Sudan rejected a UN resolution
on the Darfur conflict
The PCP was suspended from political activities following the attempted coup in March.
State officials have said al-Turabi was linked to a similar coup attempt in September 2004.
Farid said the military men had begun conscripting supporters for the coup in the suburbs of the capital and had planted allies in the television and radio stations as well as telephone exchanges and electricity centres to cut all communications in the capital.
He added they had bought thuraya phones to talk to each other when the telephone and satellites were down.
"The security forces arrested them one day before the planned date of the plot," Farid said.
Zero hour for the coup was to be 5 am (0200 GMT) on 28 March 2004. He said they chose that time as military checkpoints are in place in Khartoum between midnight and 4 am
Sudan levelled charges against 36 for the plot last July.
"This is proof to the United Nations and the Security Council that the Sudanese judiciary is capable of convicting any Sudanese, whether they be from the ruling party or an opposition party"
Farid said since then 12 had been released by the court because of a lack of evidence against them, including al-Hajj Adam Youssef, a senior PCP official who fled the country and is rumoured to be in hiding in neighbouring Eritrea.
But Youssef is still accused of involvement in the September coup attempt. This trial of 72 accused is still continuing.
"This is proof to the United Nations and the Security Council that the Sudanese judiciary is capable of convicting any Sudanese, whether they be from the ruling party or an opposition party," Farid said.
Sudan has rejected a UN Security Council resolution referring alleged war crimes in its remote western Darfur region to the International Criminal Court.
The government says its judicial system is capable of convicting anyone accused of war crimes.