KHARTOUM (Reuters) - Omar Hassan Bashir survived multiple armed rebellions, economic crises and attempts by the West to make him a pariah before he was finally ousted as Sudan’s president by the military on Thursday following protests against his 30-year rule.

FILE PHOTO: Sudan's President Omar Hassan al-Bashir delivers a speech during a rally in Al Fasher, northern Darfur March 8, 2009. REUTERS/Zohra Bensemra/File Photo

In an address on state television, Defence Minister Awad Mohamed Ahmed Ibn Auf said Bashir, who seized power in a bloodless coup in 1989, was under arrest in a “safe place” and a military council was now running the country. Sudanese sources said Bashir was at the presidential residence under heavy guard.

Tens of thousands of people danced and chanted anti-Bashir slogans in the streets of Khartoum, a sharp contrast to the past, when he fired up crowds with anti-Western rhetoric, sometimes breaking into impromptu dances.

Bashir, 75, was a master at playing rival factions among security services, the military, Islamists and armed tribes off against each other. But he underestimated the anger of young Sudanese men and women demanding an end to economic hardships.

He ultimately faced almost daily defiance in towns and cities across Sudan despite a crackdown by security forces using teargas and sometimes live ammunition, in which dozens of people have been killed.

Addressing soldiers in January, Bashir warned the “rats to go back to their holes” and said he would move aside only for another army officer or at the ballot box.

“They said they want the army to take power. That’s no problem. If someone comes in wearing khaki, we have no objection,” Bashir, wearing his military uniform, told soldiers at a base in Atbara, the northern city where protests erupted.

Later in January, Bashir declared a national state of emergency that expanded police powers and banned unlicensed public gatherings. He told parliament to postpone, not cancel, constitutional amendments that would allow him to seek another term.

Bashir, who came to power as an obscure army brigadier, has long been both a divisive and pragmatic figure.

Sudan drew heavy criticism for providing refuge to Osama bin Laden. Bashir later tried to improve the country’s image by striking a 2005 peace deal that ended more than two decades of north-south civil war.

Since taking office in what was then Africa’s largest country, he fought a protracted civil war with southern rebels which ended with the secession of South Sudan in 2011, and the loss of more than 70 percent of Sudan’s oil.

Slideshow ( 9 images )

Sudan has suffered prolonged periods of isolation since 1993, when the United States added Bashir’s government to its list of terrorism sponsors for harboring Islamist militants. Washington followed up with sanctions four years later.

The protests in Sudan followed the success of similar but much bigger demonstrations in Algeria in forcing long-ruling President Abdelaziz Bouteflika to exit.

In the months before protests began in Sudan, people had already been struggling to makes ends meet.

The government had hoped for quick financial support from wealthy Gulf Arab allies after Bashir sent troops to Yemen as part of a Saudi-led alliance fighting an Iran-aligned movement, but help was slow to arrive.

The trigger for the wave of protests was a government attempt to introduce unsubsidized bread. The demonstrations quickly turned political, demanding Bashir step down.

HUMBLE BEGINNINGS

Bashir was born on Jan. 1, 1944 to a poor farming family in Hosh Bannaga, a small village consisting mainly of mud houses and dusty streets on the eastern bank of the Nile River, some 150 km (93 miles) north of the capital Khartoum.

He has often played up his humble beginnings. In January, he repeated a story he told in 2013 of how he broke a tooth while carrying concrete at a construction site where he worked as a student to pay for his education.

Bashir said he refused a silver tooth implant when he joined the military because he wanted to remember that incident whenever he looked in the mirror.

As a young officer in the parachute regiment, he joined the armed wing of the Islamist Movement, which broke away from the Muslim Brotherhood and has ruled Sudan since Bashir took office.

The head of the junta that seized power in 1989, Bashir dissolved the military council in 1993 and ruled with an iron fist.

But it was Bashir’s response to the insurgency in the western Darfur region that has come to define his legacy.

Facing an International Criminal Court arrest warrant over the death of an estimated 300,000 people in Darfur, Bashir held on to power as a shield against a trial similar to that of former Yugoslav President Slobodan Milosevic.

Defying the ICC, Bashir continued to visit friendly foreign states as he tried to show he had not been cowed by the international arrest warrant.

Bashir has sought to play on regional and international differences to improve Sudan’s standing. In 2013, he hosted then Iranian President Mahmoud Ahmedinejad in Khartoum.

Bashir courted Turkey and Russia, at the same time as Khartoum stepped up security cooperation with Washington, hoping to speed up the country’s emergence from decades of U.S. sanctions that were lifted in 2017.

Facing the most sustained challenge to his rule yet, Bashir had counted on steadfast support from the security establishment he had nurtured for three decades to see him through.

“We say to the youth, this country is yours, protect it, and if it goes up in smoke we won’t be refugees, we will die here,” he said in January, wearing white robes and waving his trademark cane.