And in Libya, an aging general is battling to establish himself as a new strongman, promising to end the chaos that kicked off when Libyans threw out their own dictator eight years ago.

The hopes inspired by the Arab Spring uprisings of 2011 soured long ago. But across North Africa, the reverberations are coursing through the region once again, shaking autocratic governments and posing new questions about the future.

Veterans of the Arab Spring struggles say the scenes feel like flashbacks to chapters of a common story. The masses now clamoring for the removal of President Omar Hassan al-Bashir of Sudan evoke the crowds that gathered in Tahrir Square in Cairo or outside the Tunisian interior ministry eight years ago.

But the setbacks and disillusionment are familiar as well. Algerian generals may have forced an end to President Abdelaziz Bouteflika’s 20-year rule to placate the crowds, but Algerians are now confronting the difficulty of challenging the entrenched system of cronyism and corruption that governed from behind him.

And a general’s attempt to end the chaos in Libya by instituting a new autocracy recalls the unhappy outcomes of the uprisings in Egypt, Bahrain, Syria and Yemen.

“History repeats itself,” Islam Lotfy, a leader of the Egyptian uprising of 2011 who is now living in forced exile in London, said ruefully. “It’s déjà vu for us.”

Image

Supporters of Abdel Fattah el-Sisi, then a General in the Egyptian military, at a 2013 rally in Cairo’s Tahrir Square.CreditNarciso Contreras for The New York Times

Most of all, the new outbreak of unrest across North Africa is a reminder that the meaning of the history of the Arab Spring remains bitterly contested.

While authoritarian governments around the region have sought to drive home the moral that popular revolutions lead only to bedlam, the young people of Algeria and Sudan have evidently learned a different lesson: that nonviolent protests in big enough numbers can oust even the most deeply entrenched dictator.

“It is a lesson of the history of 2011, and of all revolutions for all times,” Amjed Farid, a Sudanese activist and intellectual, said in a telephone interview.

The renewed unrest across North Africa has also underscored the idea that the fundamental problems that exploded into the earlier uprisings have continued to fester, including soaring populations of disaffected young people, closed and corrupt economies unable to absorb job seekers and authoritarian governments unresponsive to the public.

With President Trump expected to play host to President Abdel Fattah el-Sisi of Egypt at the White House on Tuesday, some scholars say the new upheaval is a warning of the risks of embracing such autocratic allies too closely.

Mr. el-Sisi, 64, came to power in a military takeover that shut down Egypt’s experiment with democracy in 2013. Now he is coming to Washington to seek at least a tacit blessing ahead of a referendum to change the Egyptian constitution so that he can stay in power until 2034 — in effect, as president for life.

At the same time, Mr. el-Sisi has also indicated that he intends to sharply reduce energy subsidies in the summer, steps that have set off unrest in Egypt before and now come at a time of high unemployment and raging inflation.

Philip Gordon, a former White House coordinator for the Middle East and North Africa under President Obama, argued that the upheaval in countries like Algeria and Sudan underscored that dictators like Mr. el-Sisi cannot be relied on for durable stability.

Image

President Omar al-Bashir of Sudan, left, being greeted by President Abdel Fattah El-Sisi of Egypt in Cairo earlier this year.CreditEgyptian Presidency, via Associated Press

“If a regime is not able to be more responsive to its citizens, eventually they will rise up again,” he said.

“Repression alone cannot save you forever,” he added. “You have to treat your people better.”

Activists in Sudan and Algeria — and partisans on both sides of the battle in Libya — all say they are fighting to escape the fates of the Arab states that rose up in 2011. All of those countries, except for Tunisia, have either plunged into chaos or reverted to authoritarianism.

Now, organizers in Sudan and Algeria say that military leaders in both countries are already adopting the tactics of their counterparts in Egypt.

In Sudan, security forces have killed dozens of protesters, and perhaps more, since street demonstrations began in December. In response, Sudanese doctors had been boycotting military hospitals to protest the army’s support for Mr. Bashir and the brutal tactics he has used to try to crush the demonstrations, said Mr. Farid, the activist, who is also a member of the executive committee of the doctors’ association.

But as the largest crowds in months of demonstrations gathered outside the presidential palace in recent days, soldiers began protecting them from attacks by the police or militias loyal to Mr. Bashir.

Now, the doctors’ association is dropping its boycott of military hospitals, Mr. Farid said.

“The army strongly protected them, and it is really amazing how they are doing it, but the army is gaining popularity among the common people,” he said.

He said the military’s tactic reminded him uncomfortably of the experience in Egypt, where the generals who forced out President Hosni Mubarak won popularity as the guardians of a revolution — but ultimately co-opted and then crushed it.

“That is the risk we are facing,” he said, though he argued that Sudan’s history of revolutions and coups had better prepared its opposition parties for negotiations with the military.

Image

Anti-government protesters demonstrating last week in Algiers, the capital, after President Abdelaziz Bouteflika was forced from office.CreditRamzi Boudina/Reuters

In Egypt in 2011, Islamists worried openly about how to avoid what they called “the Algeria scenario.”

Twenty years earlier, Algerian generals had canceled a parliamentary election to prevent an Islamist victory at the polls. For the next 10 years, the Algerian army and the Islamists fought a civil war that killed more than 100,000 people.

Even despite the Egyptians’ efforts to study that lesson, their uprising followed a similar path. Islamists won control of the Parliament and the presidency in Egypt’s first free elections. But the generals dissolved Parliament and deposed the elected president, and six years later the military is still struggling to defeat a militant Islamist backlash.

Now Algerians talk openly about avoiding the Egyptian scenario.

The Algerian military’s chief of staff last week announced the removal of Mr. Bouteflika with the same flourishes that an Egyptian officer used in 2011 at the removal of Mr. Mubarak. Raising a hand in a salute to the people, he pledged to support their “legitimate demands.”

But the interim government named by Mr. Bouteflika is made up of his allies and loyalists, including a hard-line prime minister accused of rigging elections. So instead of rejoicing at the ouster of their autocrat, as the Egyptian protesters did, Algerian demonstrators have continued to demand a more sweeping end of what they dismissively call the “system.”

In Libya, the general now vying to capture Tripoli, the capital, has long modeled himself after Mr. el-Sisi of Egypt.

The Libyan general, Khalifa Hifter, first announced his plan to take power in a speech in 2014 that borrowed heavily from one made several months earlier by Mr. el-Sisi, who was then a general.

Invoking a nonexistent Libyan Supreme Council of the Armed Forces in apparent mimicry of Egypt’s council, General Hifter promised a transitional “road map,” just as General el-Sisi had done.

Image

Sudanese protesters, who had gathered outside the military’s headquarters in Khartoum on Sunday, show their support for the military’s actions protecting demonstrators.CreditAgence France-Presse — Getty Images

Supporters hail General Hifter, 75, as the only one who can rescue Libya from the chaos that has followed the revolts in Syria and Yemen, just as they say Mr. el-Sisi saved Egypt.

General Hifter’s opponents, in turn, bash him as a tyrant in thrall of Mr. el-Sisi, and say he aspires to be a strongman like the nation’s former dictator, Col. Muammar el-Qaddafi.

Stalled for a fourth day in his drive to conquer Tripoli, General Hifter’s forces on Monday retreated on several fronts around the outskirts of the city. Perhaps in desperation, his small air force also resorted to bombing the last remaining airport available for civilians, threatening to severely isolate the city.

Ghassan Salame, the United Nations special representative for Libya, condemned the bombing as “a serious violation of international humanitarian law.”

“The United Nations is deeply concerned for the welfare of the civilian population in the ongoing violence, and of the implications of the attack on the airport,” Mr. Salame said in a statement.

The turmoil in so many neighbors appears to have stirred some anxieties around Mr. el-Sisi. While the Egyptian media has lauded General Hifter’s advance, it has largely overlooked the uprisings in Algeria and Sudan, which have dominated headlines elsewhere in the region.

“That is a good indication of how worried they are,” said Khaled Dawoud, an Egyptian journalist who participated in the Arab Spring uprising and for a time became the president of a liberal political party.

Some Egyptians, he said, still take pride in setting the template for the nonviolent uprisings now flaring in Algeria and Sudan.

“The power of the people has proved to be alive, and the desire to have a president who does not stay for life,” Mr. Dawoud said. “The model we set in 2011 remains alive despite the tremendous efforts to crush and distort it.”

A version of this article appears in print on , Section A, Page 10 of the New York edition with the headline: Hopes Raised During Arab Spring Are Being Revived Across North Africa. Order Reprints | Today’s Paper | Subscribe