At least 16 Army commanders were arrested on Thursday in Khartoum after a foiled coup, Sudan military council has confirmed.

Is there a story unfolding in your community? Let Hivisasa know

Protests had rocked the North Africa nation for the last four months, despite the ouster of Omar al Bashir, who ruled the country for over 30 years.

Even after the agreement between the military council and the opposition, it's not clear who organised the attempted coup. Those arrested are mostly serving officers and five retired commanders.

"Officers and soldiers from the army and National Intelligence and Security Service, some of them retired, were trying to carry out a coup," General Jamal Omar of the ruling military council said in a statement broadcast live on state television.

"The regular forces were able to foil the attempt," he said, but did not say when the attempt was made.

According to the military council, those behind the foiled coup are people against the agreement reached, which was brokered by African Union.

"This is an attempt to block the agreement which has been reached by the Transitional Military Council and the Alliance for Freedom and Change that aims to open the road for Sudanese people to achieve their demands," Omar said.

Intense mediation by African Union and Ethiopian mediators finally led to the agreement reached on the new joint governing body on July 5.

The agreement proposes a little more than a three-year transition period, with the president of the new ruling body to be held by the military for the first 21 months and a civilian for the remaining 18 months.

Sudan paved way for independence of Southern Sudan, which has also been struggling for stability. Last week, President Salva Kiir visited Kenya where he held talks with President Uhuru Kenyatta.