But global notoriety was never much of a problem for Mr. al-Bashir, 75, at home in Sudan, a vast African country with a long history of war and suffering. He outwitted rivals who underestimated him, steered a decade-long oil boom that swelled Sudan’s middle classes, and forged a network of security forces and armed militias to fight his wars that some likened to a spider’s web with Mr. al-Bashir at its center.

That carefully constructed edifice of power crumbled this week as thousands of protesters massed outside his Khartoum residence, chanting slogans and braving gunfire as rival gangs of soldiers exchanged fire. The oil money was running low, the economy was in tatters and young Sudanese, in particular, had had enough. The spider had to go.

“Just fall, that is all!” they chanted.

On Thursday morning, the military ousted him, ending his 30-year rule in the face of the sweeping demonstrations. It said it had taken Mr. al-Bashir into custody, dissolved the government and suspended the Constitution.

Representatives of the principal protest group, the Sudanese Professionals Association, which had been expecting a statement from the military and were preparing to negotiate a transition to civilian rule, greeted the announcement with disappointment.