For decades, Ahmad Gaid Salah worked behind the scenes to maintain his grip on Algeria, serving as commander of land forces during the country’s vicious 1990s civil war, a top military official during nearly two decades of peace and relative prosperity afterward, and as de facto ruler of the country during the past 10 months of political turmoil.

On Monday, barely a week after the lieutenant general installed a new president at the helm of the oil-rich north African military giant, over the objections of a massive nationwide protest movement, Salah died, succumbing to a heart attack.

The powerful, wily army chief was 79 years old.

A replacement, Said Chengriha, was quickly named by the country’s new president, Abdelmadjid Tebboune, state TV reported. But Salah’s passing adds to political uncertainty in Algeria, which is Africa’s largest nation by landmass and a crucial provider of energy to Europe.

Salah, a protege of the country’s former long-time president, Abdelaziz Bouteflika, ultimately turned against his boss last year, pushing to oust him amid a popular protest movement. He then sought to install a successor in the face of a population that has been increasingly wary of the military’s role in politics, and had begun to target him in protests and on social media.

A skilled and seasoned insider, Salah was able to pull the levers of Algeria’s obscure political system like few others, using his powers and influence to jail senior officials over the last year on corruption charges in an attempt to appease protesters and redirect their ire away from the armed forces.

Algerians protest against President Bouteflika Show all 14 1 /14 Algerians protest against President Bouteflika Algerians protest against President Bouteflika Protests against President Bouteflika in Algiers on March 15 Reuters Algerians protest against President Bouteflika Protesters march in Algiers to demand the resignation of President Bouteflika on March 15 Reuters Algerians protest against President Bouteflika Protesters carrying the national flag protest against President Boueflika on the Republique Plaza on March 17 AP Algerians protest against President Bouteflika Algerians march during a protest in Algiers on March 15 AP Algerians protest against President Bouteflika Students protest in Algiers on March 19 Reuters Algerians protest against President Bouteflika Protesters hang national flags atop a building in Algiers on March 15 Reuters Algerians protest against President Bouteflika Algerian doctors protest against President Bouteflika on March 19 in Algiers EPA Algerians protest against President Bouteflika Algerians demand the resignation of President Bouteflika in a protest on March 15 in Algiers AFP/Getty Algerians protest against President Bouteflika A woman holds a placard with the photo of President Bouteflika during a protest on March 15 in Algiers AP Algerians protest against President Bouteflika Algerians demand the resignation of President Bouteflika in a protest on March 15 in Algiers AFP/Getty Algerians protest against President Bouteflika Algerian doctors march against President Bouteflika on March 19 in Algiers EPA Algerians protest against President Bouteflika Algerians take part in a demonstration against President Bouteflika on March 19 in Algiers AFP/Getty Algerians protest against President Bouteflika Algerian doctors protest against President Bouteflika on March 19 in Algiers AFP/Getty Algerians protest against President Bouteflika Employees of the Algerian Ministry of Vocational Education and Training protest against President Bouteflika in Algiers on March 18 EPA

“Salah was obviously in favour of the military’s involvement in politics,” said Jalel Harchaoui, a north Africa specialist at the Clingendael Institute, a Dutch think tank. “He had also shown a keen ability to influence the justice system over the last several months. Vis-à-vis the outside world, he had become a strong figure and had become familiar with key interlocutors such as the Gulf states, for instance. All of that is up in the air now.”

State television declared three days of mourning following the death, as some among the protesters worried his legacy would be whitewashed. Many accuse him of exacerbating tensions between the country’s Arab and Amazigh or Berber communities, needlessly straining relations along one of the key fault-lines of the country of 40 million.

“The sad thing is that he will go down in history books as a national hero,” one prominent protester told The Independent. “He wasn’t.”

Mr Chengriha, Salah’s replacement, is known as an anti-terrorism specialist. But, unlike Salah, the 74-year-old is too young to have participated in the 1950s war for independence from France, the conflict that shaped Algeria and its leadership.

Experts suggest he may not be able to match up to the domestic and international gravitas of Salah, potentially providing an opening for a persistent protest movement that has taken to the streets week after week since February demanding fundamental changes to Algeria’s political system.

“Ahmed Gaid Salah was old-school and rather unique,” said Mr Harchaoui.