BAMAKO, Mali — From the ancient desert town of Timbuktu to refugee camps in neighboring countries, voters chose Sunday who should lead Mali out of the political upheaval that left the country's north in the hands of al-Qaida-linked militants for much of last year.

Mali's next president will be tasked with not only rebuilding the country's shattered economy but also resolving a simmering separatist movement in the far north. Voters heading to the polls on Sunday said they wanted a leader who could bring a lasting calm to the country following a year and a half of turmoil.

It was former Prime Minister Ibrahim Boubacar Keita's race to lose after winning nearly 40 percent of the first-round vote and receiving endorsements from almost all the other candidates. He faced former Finance Minister Soumaila Cisse, and results are expected by Friday.

"People are saying 'Will the turnout be what we hope?' but I am certain it will be," Keita told reporters in Bamako after casting his own ballot. "And the rain here is a blessing and a good sign."

Polling stations began closing at 6 p.m. (1800 GMT) as scheduled, though some had opened late in Bamako, the capital, because of heavy downpours early Sunday.

Earlier in the day, election workers had waded through reddish floodwaters to transport voting materials to the polls.

At one station, Youssouf Coulibaly chewed on cola nuts as he escaped the rain by waiting in a hallway for his turn to vote, accompanied by six family members.

Since Mali's crisis began, Coulibaly said he has found it more difficult to sell his traditional medicines. Food has become more expensive to bring home and the 67-year-old and his family are now just eking by.

"Today everyone agrees that the man for the job is Ibrahim Boubacar Keita, who can bring us security and peace because he's the one who can stand up to the Tuareg rebels who have put the country in this situation."

"We are tired of this crisis and of the insecurity we have been living with," echoed Amara Traore, 65, whose orange boubou lit up the line of voters waiting for their polling stations to open early Sunday.

Many voters in the south blame the Tuareg separatists for unleashing the ruinous chaos because it was their rebellion that provoked the soldiers behind the coup in March 2012. In the aftermath, the al-Qaida-linked extremists took hold across the north and began imposing a harsh interpretation of Islamic Shariah law that meted out public amputations and whippings.

The jihadists fled the north's major towns after a French-led military operation was launched in January.

Sunday's presidential runoff vote is aimed at unlocking some $4 billion in aid that has been promised to help Mali recover from the political crisis that also decimated its tourism industry. The funds, though, are contingent on a democratically elected government being in place to replace the interim leaders.

Keita has run on a campaign of restoring Mali's honor and dignity.

Cisse's supporters, though, say their candidate has more concrete ideas for creating jobs and revitalizing the Malian economy. "Cisse's plans are more detailed and more coherent. That's why I'm voting for him," said Oumar Couilbaly, 28, of Bamako.

Cisse said Sunday he would respect the outcome of the runoff vote after finishing second in the first round. "I have submitted myself to the verdict of the ballot box long before today," he told journalists as he cast his own ballot.

While Cisse has pulled support from his hometown of Timbuktu, Keita appears to have done better across the troubled north overall. Cisse has said he will not accept autonomy for the region separatists call Azawad. By comparison, some within the National Movement for the Liberation of the Azawad have endorsed Keita because of his promise to hold a national dialogue on the crisis there.

In the northern town of Gao, just six months ago suicide bombers were launching attacks and jihadists were battling Malian troops in the heart of downtown.

Gao resident Moussa Tahirou Maiga said despite security improvements, the city's economy remains paralyzed and many are looking to Keita to create jobs. "He has shown his patriotism," said Maiga, 35, who teaches information technology. "He's viewed here as the man who can change a lot of things."

Turnout in the first round of voting was nearly 50 percent, though in the northern provincial capital of Kidal where rebel flags still fly, it was a mere 12 percent.

On Sunday, local election official Fadimata Maiga said polls had opened on time in Kidal. "Turnout appears to be better than the first round," she said.

The presidential election is the first since the separatist Tuareg rebellion in northern Mali in early 2012 sparked anger within the military and led to a coup that overthrew longtime President Amadou Toumani Toure. The chaotic aftermath of the March 2012 government overthrow allowed the separatists, and later al-Qaida-linked extremists, to grab control of northern Mali, an area the size of France.

The French-led military offensive sidelined the radical militants, but secular rebels have made their way back into Kidal, where they maintain a hold despite the return of the Malian military to the area. Talks with the Tuareg rebels, who want to have an independent state they call Azawad, will be among the first challenges to face the new president and are due to begin about two months after the government is in place.

Also of key importance will be finding a way home for the nearly 200,000 Malians who remain refugees in neighboring Mauritania, Niger and Burkina Faso. The United Nations refugee agency said initial estimates indicated only about 1,220 of them voted in the first round, though election materials also were being flown in for the second round poll.