CAIRO — A former prime minister of Algeria's old political guard was declared president Friday in a controversial vote marred by protests and apathy, signaling that the political turmoil is far from over in the North African nation.

The country’s electoral commission announced in preliminary results that former prime minister Abdelmadjid Tebboune, 74, won Thursday’s election outright with 58 percent of the vote, a significant margin of victory that negated the need for a runoff.

Tebboune, as well as his four opponents, served under the regime of Algeria’s longtime autocrat, Abdelaziz Bouteflika, who was toppled by massive street demonstrations this year after he announced that he would seek a fifth term in office. The final voter turnout was 40 percent, electoral commission head Mohamed Charfi announced in a televised address in the capital, Algiers.

Algerian authorities, especially the nation’s powerful military, had championed the election as a way to bring back stability. They also said they hoped it would end nearly 10 months of street demonstrations by opposition parties and activists demanding the erasure of all vestiges of the ruling elite.

On Friday, state television announcers declared Thursday’s voter turnout a satisfactory mandate by the people to move forward. But thousands of Algerians took to the streets again to protest what they have described as a sham election intended to preserve Bouteflika’s ruling clique. All of the candidates, who also included another former prime minister, were widely denounced by street activists as “children of the regime.”

The run-up to the first election since the ouster of the 82-year-old Bouteflika, who ruled Algeria for 20 years, was filled with turmoil and tension. On Thursday, those emotions boiled over as protesters defied a heavy police presence to stage rallies in Algiers and other cities and called for boycotting the election.

 Protesters stormed some polling stations, briefly suspending voting, as police used water cannons and batons to disperse crowds.

 For months, thousands of protesters — collectively called the “Hirak” movement — have staged weekly demonstrations. In their minds, the toppling of Bouteflika — the fifth autocrat since the 2011 Arab Spring revolts to fall from power — was only the first notch in their struggle to usher in a more democratic transition. They want an end to the cabal of war veterans, lawmakers, business tycoons and clans that has backed Bouteflika for decades and still retains control of the country. It is collectively known as “le pouvoir” — the power.

 “The system must go,” protesters have chanted at numerous demonstrations.

At a news conference Friday, Tebboune urged protesters to work with him “to open a new page” in the country. He said he would begin discussions to create a new constitution that would be approved by a referendum in the months ahead.

With his electoral victory, Tebboune faces an uphill struggle to bring stability to what is both the Arab world’s and Africa’s largest nation. Algeria, one of the world’s major oil and gas producers, plays a vital role in addressing regional conflicts, containing illegal migration to Europe and countering terrorism.

 The political uncertainty comes as the country’s economy is faltering, driven by falling global oil and gas prices. The result has been massive unemployment, especially among youths. Many Algerians view the government as corrupt and inept.

Tebboune held several other ministerial positions in Bouteflika’s government, including communications and housing. But he was fired by Bouteflika after serving for three months as prime minister, when he criticized some of the president’s core allies.