MONROVIA, Liberia — Liberia has not witnessed a peaceful transition of power since 1944, and the fate of past presidents — since 1971, four of them have either died in office or been sent into exile — is so grim that many Liberians consider the presidential palace to be haunted.

That legacy hung over this West African nation, founded in the early 19th century by freed American slaves, on Tuesday as voters chose a successor to President Ellen Johnson Sirleaf, whose term ends next month.

In 2005, Mrs. Sirleaf became the first woman to be elected a head of state in Africa. During her 12 years in power, Liberia tried to turn the page on two civil wars that had left this once moderately prosperous country in ruins. She shared the Nobel Peace Prize in 2011 in recognition of her contributions to democracy.

But she was faulted for her handling of the Ebola epidemic, and the country remains one of the world’s poorest. And expectations are high in this rapidly growing society, in which 42 percent of the population is under 15. According to the International Monetary Fund, about half of Liberians are poor and about half have uncertain access to food. Job creation is arguably the country’s most important domestic priority.