CAIRO — Algeria’s influential army chief on Tuesday urged that President Abdelaziz Bouteflika be declared unfit for office, a move that could pave the way for the ailing leader’s ouster amid weeks of mass protests against his lengthy rule.

The declaration by Gen. Ahmed Gaid Salah, in a speech carried on state television, was the latest sign that Bouteflika’s core allies were increasingly seeing his departure as the way to solve Algeria’s biggest political crisis in decades. Virtually every day, including Tuesday, tens of thousands of protesters have marched in cities across this North African nation, demanding that Bouteflika step down.

“We must find a way out of this crisis immediately, within the constitutional framework,” Salah said.

Salah, among the most powerful men in Algeria, added that “the only guarantee for political stability” is to launch the constitutional process that would empower lawmakers to determine whether Bouteflika is fit to exercise the duties of the presidency. The 82-year-old leader has barely been seen in public since a 2013 stroke and recently spent two weeks in a medical facility in Switzerland.

If the measure to declare him unfit is approved by a two-thirds majority in Parliament, Bouteflika would be forced to step down. Then, the president of the Senate would take the reins of government until elections are held.

Earlier this month, Bouteflika announced he would not seek a fifth term in office, bowing to populist pressure from the massive protests. He postponed presidential elections next month in the hopes of calming down the tensions.

But Algerians have kept flooding the streets of the capital, Algiers, to denounce Bouteflika, seeing his moves as calculated to extend his fourth term. Algeria’s longest-serving head of state, he has ruled the nation since 1999. He oversaw the end of Algeria’s decade-long civil war against Islamists, in which as many as 200,000 people died, bringing him popularity and very little resistance from a population that has long been cowed by the country’s all-powerful security and intelligence services.

Today, though, many Algerians have grown discontented by the rule of Bouteflika and his clique of relatives and war veterans who fought for Algeria’s independence against French rule and who still dominate the country. They have been accused of stealing the wealth of Algeria, a major gas and oil producer, while caring little about the country’s masses, especially its youths, who face high levels of unemployment and few opportunities.

As of now, an interim leadership is in the process of being created to plan for the yet-to-be-scheduled elections. A new constitution will be drawn up and submitted for a public referendum, as well as a host of economic and political measures promised by Bouteflika.

Even though Bouteflika has promised to step down, Algerians remain suspicious. Many of his loyalists and allies are poised to rule the country in the months and years ahead. Still, many of Bouteflika’s key allies have already abandoned him, including judges, members of his ruling party and business leaders.

Salah’s questioning of Bouteflika’s fitness to lead the government could trigger his ouster. If lawmakers follow through and apply Article 52 of the Algerian constitution, the chairman of Parliament’s upper house would serve as a caretaker president for at least the next month and half.

That’s what the roughly 6,000 protesters, mostly students, who filled the streets in downtown Algiers on Tuesday wanted.

“The system must go,” Belkacem Abidi, 25, one of the demonstrators, told Reuters. “There is no point for it in resisting.”