ALGIERS — Thousands of Algerians poured into the streets of the capital after Friday prayers, demanding a transition toward democracy and the ouster of key allies of former president Abdelaziz Bouteflika, who resigned this week after 20 years in power.

The protests were the starkest indicator yet that Bouteflika’s ouster, at the insistence of the country’s powerful military, has failed to satisfy the tens of thousands of Algerians who have staged massive anti-government protests over the past six weeks in this vast North African country.

Instead, Bouteflika’s departure appears to be only the start of a struggle whose outcome is far from certain. Protesters are more emboldened in seeking a dismissal of the remaining vestiges of the political order that has governed the country since it won independence from France in 1962 — and that is now widely derided for its cronyism and corruption.

A circle of Bouteflika allies — the influential lawmakers, relatives and business executives known as the “pouvoir,” or power — remains in control of the levers of the nation. They have become the protesters’ new targets.

“The people want them all out,” chanted the demonstrators Friday near the ornate main post office in the center of the capital. By the afternoon, thousands more protesters from all walks of life — young and old, middle class and poor — were peacefully flowing along the main boulevards as contingents of riot police watched.

The mood was festive and joyful, with many draped in Algerian flags or waving them. Others carried posters emblazoned with images of officials in Bouteflika’s government.

One read: “You will be judged.”

Algeria’s Abdelaziz Bouteflika resigns, ending his rule after two decades

Friday’s demonstrations came at the end of one of the most tumultuous weeks for Algeria, ­Africa’s largest country by area and a major oil and gas producer. Bouteflika, its longest-serving head of state, joined the ranks of autocrats in Libya, Egypt, Tunisia and Yemen who have been forced out of power by popular revolutions since the Arab Spring uprisings swept across the region in 2011.

A veteran of Algeria’s war for independence, Bouteflika came to office in 1999 and presided over the end of a bloody civil war, known as “the Black Decade,” that killed more than 200,000.

As disillusionment grew over his government’s corruption, high unemployment and lack of opportunities, Algerians grew frustrated with his clinging to power despite his increasing infirmity. He also had little connection to Algerians, having virtually disappeared from the public eye after a stroke in 2013.

So when the ailing 82-year-old decided to run for a fifth term in office, tens of thousands of Algerians began protesting in February. That, and a slew of defections by key allies, eventually forced Bouteflika to postpone the elections scheduled for this month and agree not to run for another term.

But many Algerians saw the move as a way to extend his fourth term, and so the massive protests continued. The nation’s all-powerful military was also losing patience. Bouteflika’s political life began to unravel when Lt. Gen. Ahmed Gaid Salah, the army chief of staff, urged lawmakers to deploy constitutional measures to declare the president unfit for office. On Tuesday, Gaid Salah bluntly demanded that Bouteflika vacate the presidency. Hours later, he did.

Algeria shows the forces of the Arab Spring are still alive

Many Algerians, though, remain wary. The constitution calls for the head of the upper house of Parliament, Abdelkader Bensalah, to become interim leader until an election can be held. But Bensalah has also been a key Bouteflika ally.

Also remaining in the political picture is Said Bouteflika, the president’s powerful brother, as well as other influential Bouteflika backers.

On Friday, many of the protesters were blunt in their disapproval of “le pouvoir.” Some carried effigies of Said Bouteflika and Ali Haddad, a business tycoon and Bouteflika ally who was arrested last weekend while trying to leave the country and accused of corruption. The effigies of the men, along with another member of “le pouvoir,” had nooses around their necks.

“I am protesting for the same reasons I did on the first day,” said Slim Saci, a 37-year-old human resources manager who joined the demonstrations with his girlfriend. “Against injustice, for a democratic and free Algeria where there is equality between men and women.”

Rachid Chaibi, an activist and member of the opposition Socialist Forces Front, a party known as the FFS, said the fundamental goal of the protesters is “the radical change of the entire existing system.”

“Algerians don’t want a replacement of a facade,” said Chaibi. “They want to rebuild their country’s political and social system from ground zero. That’s something everyone agrees on.”

Their president gone, Algerians now want democracy. Will the army allow it?

Concerns remain about the army’s role in the transition. While Algerians have applauded Gaid Salah and the military for speeding up Bouteflika’s departure, they have not forgotten that until two weeks ago, the army was instrumental in keeping the regime in power. In 1988, the army violently cracked down on protesters and later annulled a 1991 election won by Islamists, plunging the country into civil war.

Many Algerians also are aware that Egypt’s army played a similar role during the 2011 uprising that brought down President Hosni Mubarak, and that it later ousted the democratically elected Islamist president in a coup. Today, Egypt’s former top general, Abdel Fatah al-Sissi, is president, and its military is an omnipresent force.

While the Algerian army’s grip is not as strong, Gaid Salah and other top brass remain kingmakers. On Friday, some protesters expressed concern about the army’s growing involvement in politics.

Smail Ahcene, 35, the owner of a car rental company, said Gaid Salah’s call for constitutional procedures to declare Bouteflika unfit for office was “an entanglement” and that the military “should not go into that aspect.” The army, he added, must remain neutral.

“Its role, now, should be to assure the protection of this revolution,” said Ahcene, who was carrying an Algerian flag.

Raghavan reported from Cairo.

Their president gone, Algerians now want democracy. Will the army allow it?

Tens of thousands protest Algerian leader’s quest for a fifth term

Algeria’s powerful army chief calls for president to be declared unfit for office

Today’s coverage from Post correspondents around the world

Like Washington Post World on Facebook and stay updated on foreign news