In a televised statement, the defense minister also announced a state of emergency for three months and a suspension of the constitution.
He became notorious for a brutal crackdown on insurgents in the western Darfur region that made him an global pariah, wanted by the worldwide Criminal Court for war crimes.
"So what we want is a transition to a democracy".
Ibn Ouf says after the two years, "free and fair elections" will take place.
"The United States continues to call for those responsible for the horrific crimes that were committed in Darfur to be held accountable for those actions", Palladino said, without specifying whether Bashir or the coup leader, Defense Minister Awad Ibnouf, should be extradited.
The SPA said the military had announced a "coup" that would merely reproduce the same "faces and institutions that our great people revolted against".
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". "A senior leader of the Sudanese Professionals" Association (SPA) put the death toll at almost 70.
The trigger for the wave of protests was a government attempt to introduce unsubsidised bread. Women have played a crucial, leading role in the protest movement against al-Bashir.
A supreme security council, made up of the intelligence, military, police and other branches, had been following the situation for some time, according to Ibn Auf.
The SPA has previously said that any transitional administration must not include anyone from what it called the "tyrannical regime".
In an apparent concession to a demand of the protesters, the National Security and Intelligence Service said in a statement that all political detainees would be released.
Earlier in the day, one main organiser, the Sudanese Professionals Association, urged protesters to remain in the streets to press for a civilian transitional government. "That is why the military has been able to monopolize the space so far".
He is one of Africa's longest-serving presidents. He became an global pariah over the bloodletting in Darfur.
- 2003: He sends troops and militiamen to crush a rebellion in the western region of Darfur.
Speaking at a joint news conference with the president of Burkina Faso on Thursday in the Turkish capital, Ankara, Erdogan refrained from voicing support for al-Bashir.
While he remained an unwelcomed political figure in the West, African leaders, however, largely stood behind him, dismissing the charges against him as a witch-hunt and refusing to hand him over for prosecution at The Hague.
Two officials in high positions in Sudan's government and military, told the AP that the military was in talks about a transitional government after forcing al-Bashir to step down. He repeatedly defied the court's arrest warrant by traveling around the world with impunity, symbolizing the court's fecklessness. Thousands of people are already celebrating on the streets, calling it a coup.
The downfall of Bashir follows the toppling this month of Algerian strongman Abdelaziz Bouteflika, also following mass protests after two decades in power.
Bashir courted Turkey and Russian Federation, at the same time as Khartoum stepped up security cooperation with Washington, hoping to speed up the country's emergence from decades of USA sanctions that were lifted in 2017. The CIA championed the approach, as Bashir rebranded himself as an ally in the fight against terrorist groups.