Sudan's President Omar Hassan al-Bashir has been ousted and subsequently arrested by the country's military.

Al-Bashir is wanted on genocide charges in connection with atrocities in Darfur, the defense minister announced on Thursday.

The announcement comes after nearly four months of mass protests over his long, authoritarian rule.

"I announce as minister of defense the toppling of the regime and detaining its chief in a secure place," General Awad Ibn Ouf said in a statement.

Ibn Ouf said Bashir was taken to a "safe place" after the "toppling of the regime." The military will now rule the country for the next two years. He cited "poor management, corruption, and an absence of justice" and he apologized "for the killing and violence that took place".

"The armed forces will take power with representation of the people to pave the way for Sudanese people to live in dignity," said Ibn Auf, the country's vice president, and defense minister before declaring a three-month state of emergency.

Al-Bashir rose to power in 1989 and during his time in power he has purged Islamists and insiders from his party, and waged war across the south and west of his country, bombing civilians in the Nuba Mountains and, according to the International Criminal Court, presided over war crimes, crimes against humanity and genocide in the western region of Darfur.

Sudan's constitution was being suspended, border crossings are being shut until further notice and airspace has been closed for 24 hours.

At almost 30 years in power, al-Bashir as one of the longest-serving leaders in Sudan's history.