Supporters of Joao Lourenço, the candidate of the Popular Movement for the Liberation of Angola (MPLA), cheer during an election campaign rally in Luanda, Angola, on Aug. 19. (Manuel De Almeida/European Pressphoto Agency)

As Angola moved from being a firm Soviet ally during the Cold War to a country known for oil-rich billionaires, there was one constant: President José Eduardo dos Santos, 74, who has ruled the country since 1979.

On Wednesday, Angola held its first presidential election in 38 years in which dos Santos is not a candidate, a seminal moment on a continent that has seven of the world’s 10 longest-ruling, nonroyal leaders.

Results weren’t expected for days. But it was a near-certainty that dos Santos’s party, the People’s Movement for the Liberation of Angola (MPLA), would remain in power under its candidate João Manuel Gonçalves Lourenço, the 62-year-old defense minister. Dos Santos’s children remain in key positions — his daughter is head of the state oil company and his son directs the nation’s $5 billion sovereign wealth fund.

But even if dos Santos’s political influence lives on, his departure as president represents the end of an era and offers a glimpse into how succession might play out in nations ruled by Africa’s old guard. To the east of Angola, in Zimbabwe, President Robert Mugabe is 93, and has spent 30 years in power. To the north, in Equatorial Guinea, Teodoro Obiang is 75 and has spent 38 years as president. In Cameroon, Paul Biya is 84, and in his 35th year as head of state. In Uganda, Yoweri Mouseveni is 73 and has ruled for 31 years.

In each of those countries, debates around succession have consumed the country’s attention. In Zimbabwe, there is a simmering feud between factions jockeying to put forwardMugabe’s heir, including one backing his 52-year-old wife, Grace. Analysts worry about a similarly chaotic political scenario in Cameroon when Biya dies.

Dos Santos has recently been traveling to Spain to be treated for an undisclosed medical condition. When he announced this year that he would retire, rumors swirled in Angola about who might take his place.. For a while, the consensus seemed to favor his daughter Isabel dos Santos, considered Africa’s wealthiest woman.

But last year the MPLA settled on Lourenço, who has tried to portray himself as a reformer, even though his party has been accused by critics and watchdog organizations of massive corruption, siphoning off oil revenue while a huge portion of Angolans live without basic health care or electricity. In 2015, the American rapper Nicki Minaj reportedly was paid aseven-figure sum to perform for some of the country’s wealthiest people, while about half the country’s population lives on less than $2 per day.

On Wednesday, Lourenço faced off against Isaias Samakuva, 71, the candidate for the National Union for the Total Liberation of Angola (UNITA), which fought against dos Santos’s MPLA in the country’s 27-year civil war. Opposition leaders have suggested that they don’t think the election will be credible. European Union electoral observers withdrew after they were denied access to many of the country's polling sites.

Many analysts say that dos Santos’s decision to step down, and the party's coalescence around Lourenço, could help prevent the chaos that probably will follow other long-serving leaders when they leave power.

“It should help guide a peaceful transition from dos Santos, avoiding the emergence of a power vacuum and the risk of political infighting,” wrote Soren Kirk Jensen, an Angola expert at Chatham House, a London-based policy institute.

Although dos Santos probably will remain influential, his departure leaves Angola without the leader who guided the nation through its transition from Marxism to petro-capitalism, from being an ally of Fidel Castro to an ally of Exxon, from being one of Africa's poorest nations to one of its richest (and most unequal).

“His departure means a new reality for Angola,” said José Veloso, a professor at the Independent University of Angola.

Dos Santos, the son of a bricklayer, was born in a slum of Luanda, the capital, during Portugal’s colonial rule. He received a scholarship to study petroleum engineering in Azerbaijan, then part of the Soviet Union, and became his country’s foreign minister after the country declared its independence in 1975.

When he assumed the presidency in 1979, Angola was considered one of the Soviet Union’s closest African allies. Moscow backed the MPLA government in the bloody civil war against fighters supported by the United States and South Africa.

Photos from the early 1980s show dos Santos standing with East German officials at the Brandenburg Gate, addressing a Soviet Communist Party congress in Moscow and sitting with Castro, the Cuban leader, in Havana. His first marriage was to a Russian woman.

But in 1991 he renounced Marxism, and went on to establish diplomatic relations with the United States.

After the war ended in 2002, oil production surged, enriching Angola’s elite even as the country’s poor showed some of the worst health indicators in the world. The country’s economy has been in crisis as the price of oil declined in recent years, and government services have deteriorated. Last year, a massive yellow fever outbreak occurred, due in part to a reduction in garbage collection, which presented a breeding ground for mosquitoes.

Asked this year by The Washington Post how his government would be different from dos Santos’s, Lourenço said: “We are going to make every effort to have a transparent administration. We are going to combat corruption.”

Last week, in a short speech on the outskirts of Luanda, dos Santos expressed confidence that his party would have an enduring legacy, even after he stepped down.

“I have no doubt the MPLA will win this election,” he said.