After nearly 30 years in power, Sudan’s President Omar al-Bashir has been ousted and arrested, the defence minister says.
Speaking on state TV, Awad Ibn Ouf said the army had decided to oversee a two-year transitional period followed by elections.
He also said a three-month state of emergency was being put in place.
Protests against Mr Bashir, who has governed Sudan since 1989, have been under way for several months.
Meanwhile, the main group that has been organising the demonstrations rejected the military statement and called on people to remain at a sit-in outside army headquarters.
Correspondents say protesters want a civilian council to lead the transition rather than a military one.
- Live updates on this story
- Sudan’s unrest in 300 words
- Bashir ousted: Five significant moments
“I announce as minister of defence the toppling of the regime and detaining its chief in a secure place,” Mr Ibn Ouf said in a statement.
Mr Bashir’s exact whereabouts are not known.
Mr Ibn Ouf said the country had been suffering from “poor management, corruption, and an absence of justice” and he apologised “for the killing and violence that took place”.
He said Sudan’s constitution was being suspended, border crossings were being shut until further notice and airspace was being closed for 24 hours.
As the news broke, crowds of protesters celebrated outside army headquarters in the capital, Khartoum, embracing soldiers and climbing on top of armoured vehicles.
Sudan’s intelligence service said it was freeing all political prisoners, state-run Suna news agency reported.
Mr Bashir is the subject of an international arrest warrant issued by the International Criminal Court (ICC), which accuses him of organising war crimes and crimes against humanity in Sudan’s western Darfur region.
However it is not clear what will happen to him following his arrest.
A volatile and unpredictable situation
Analysis by Fergal Keane, BBC Africa editor
This is a military coup with no clear roadmap for how the generals plan to hand over power to civilian rule.
The fear will be that they have no such intention. The security elite has calculated that removing Omar al-Bashir and imposing a curfew will buy them time and end the protests. If so this represents a serious miscalculation.
The Sudanese Professionals Association – which has spearheaded the demonstrations – and other civil society groups have made it clear they won’t accept a cosmetic change. They have the numbers and are highly organised.
The military has the guns and the capacity for imposing brutal repression. But what then? A crackdown will not resolve the desperate economic crisis that brought years of simmering resentment on to the streets last December.
There is also the question of the cracks within the Sudanese security establishment, evident during the clashes between soldiers and intelligence/militia forces in recent days. It is a volatile and unpredictable situation that demands cool heads and compromise on the part of the military. The stability of Sudan depends on how they react to continued protests.