ALGIERS (Reuters) - Algeria’s ailing President Abdelaziz Bouteflika resigned on Tuesday, succumbing to six weeks of largely peaceful mass protests driven by youth and pressure from the powerful army against his 20-year rule.

FILE PHOTO: President Abdelaziz Bouteflika claps during a swearing-in ceremony in Algiers April 28, 2014. REUTERS/Louafi Larbi/File Photo

Hundreds took to the streets of the capital after the announcement of the 82-year-old’s departure, capping protests which called for the removal of an elite seen by many as out of touch with ordinary people and presiding over an economy riven by cronyism.

Earlier in the day, army chief of staff Lieutenant General Ahmed Gaed Salah demanded the veteran ruler, who has been long in poor health, be declared immediately unfit for office.

State TV later showed a frail-looking Bouteflika, dressed in a traditional winter robe, handing his resignation letter to the head of a constitutional council. Also present was Abdelkader Bensalah, chairman of the upper house of parliament, who will run the country for 90 days until elections are held.

“I have taken this step because I am keen to put an end to the current bickering,” Bouteflika said in a letter released on state media, using his main means of communication since suffering a stroke in 2013 and largely disappearing from public view.

Western powers, some of which had demanded a peaceful solution, will be relieved that Bouteflika has quit, valuing stability in the OPEC oil producer, which is also a key gas supplier for Europe and partner to fight militants.

Analysts say it was unclear whether the demonstrations will end, however. They were started initially to protest Bouteflika’s plan to seek a fifth mandate but then widened to include calls from some youth and lawyers for wider reforms.

As Bouteflika’s grip on power started to loosen over recent days, some protesters began shifting their focus to rejecting a caretaker government appointed on Sunday.

The lineup included respected technocrats but was headed by Prime Minister Noureddine Bedoui, who the opposition said was too close to the ruling elite dominated by business tycoons and veteran fighters of the 1954-62 independence war with France.

“What is important to us is that we do not accept the (caretaker) government,” Mustapha Bouchachi, a lawyer and protest leader, told Reuters before Bouteflika quit. “Peaceful protests will continue.”

Hundreds of students marched early on Tuesday through the capital Algiers, calling for a new system in a country where more than one in four Algerians under the age of 30 - some 70 percent of the population - are unemployed.

Bouteflika’s supporters had sought to stop the dissent by evoking the 1990s when some 200,000 were killed in civil war with Islamists, warning even of a scenario like Syria, embroiled in an eight-year-long conflict.

But only around one person was confirmed to have died during the protests, a man believed to be around 60 years old who suffered a heart attack, with most rallies peaceful and protesters cleaning up the streets before going home.

In Egypt, more than 800 people were killed in the 2011 uprising that brought down Hosni Mubarak.

CHANGES

Algeria has transformed during the protests, with people losing fear of criticizing the government and state media first ignoring and then, after a mutiny of reporters, covering the dissent.

Supporters in the ruling FLN party and business people gradually abandoned Bouteflika. The military at first stayed in the barracks but step by step increased pressure, first only indirectly in an army magazine editorial saying the military shared the same vision as the people.

Slideshow ( 10 images )

Then chief of staff Salah proposed last week to invoke a constitutional clause to remove Bouteflika on health grounds.

In another sign the end was approaching, several oligarchs close to his camp had been banned from traveling abroad in the past few days.

Tuesday started like any other weekday since the protests began, with some students protesting and others going to work after joining a mass rally on Friday, Algeria’s weekend.

With many at home or in restaurants at dinner time, TV stations flashed a blitz of comments from Salah that Bouteflika’s removal should happen immediately.

“There is no more room to waste time ... We decided clearly ... to stand with the people so all their demands get fulfilled,” Salah said after a meeting with senior officers, state news agency APS said.

A veteran of Algeria’s war for independence and the only leader many Algerians have known, Bouteflika was first elected president in 1999 and established himself by ending the civil war.

He had only on Monday said he would quit before the end of his term on April 28 without giving a date. He had also vowed to undertake unspecified measures for the sake of stability, making many wonder what would happen next.

An hour later, he announced he was standing down in a statement posted by APS on Twitter.

Hundreds took to the streets in the city center, where the Feb. 22 mass protests first broke out, waving Algerian flags.

“The army and the people are one” and “Game over”, banners read.