OUAGADOUGOU - Voters in Burkina Faso began casting ballots Sunday for a new president and parliament, hoping to turn the page on a year of turmoil during which the west African nation's people ousted a veteran ruler and repelled a military coup.

Security was tight as some five million voters in the nation of 20 million went to the polls to choose a new leader for the first time in almost three decades. The authorities are deploying between 20,000 and 25,000 troops to ward off the threat of a militant attack, following two recent assaults against police barracks on the country's long western border with troubled Mali.

"For the first time in 50 years there is an electoral uncertainty... we don't know the winner in advance," said Abdoulaye Soma, the head of the Burkinabe society of constitutional law. "This is a positive point and a fundamental change from the other elections that we had seen earlier." Former president Blaise Compaore was forced to flee the country following mass street protests in October 2014 against his bid to change the constitution to extend his 27-year rule.

A transitional government was put in place until fresh elections could be held.

But the country was plunged into fresh uncertainty in September this year, weeks before a planned October 11 presidential vote, when elite army leaders close to Compaore tried to seize power.

Once again angry citizens took to the streets, foiling the military coup. Its leaders were thrown behind bars and the presidential and general elections were re-scheduled for November 29.

There were problems as some stations opened late or were short of voting papers and ballot boxes, but many people said they were glad just to have the chance to choose their leader.

"I'm happy to have been able to vote. I want the candidate I voted for to take care of us," said 39-year-old Omar Tiemtore.

Voter Ousmane Francois Ouedraogo said that with Compaore - now exiled in neighbouring Ivory Coast - gone, the country was "more free and more democratic".

Former army office Compaore, 64, took power in 1987 when revolutionary former comrade-in-arms Thomas Sankara - a charismatic leader who came to be known as "Che Sankara" - was gunned down in a coup Compaore is now widely believed to have orchestrated.

Transitional president Michel Kafando hailed the vote as a victory for the country and its young people who "expressed themselves and expressed their desire for change, for democracy and freedom" by ousting Compaore.

To bolster the legitimacy of the next head of state, members of the interim government have been banned from standing as have all those who backed Compaore's bid for a third term, as well as members of his Congress for Democracy and Progress party (CDP).

The pro-Compaore CDP is still fielding candidates in the parliamentary elections and is expected to do well in parts of the country traditionally behind "Beau Blaise".

In the race for the presidency, seven of the 14 contenders were once close to Compaore, including the two favourites for the job - Roch Marc Christian Kabore and Zephirin Diabre.

"I quit state affairs in 1997. I've been through the decontamination chamber!" says Diabre.

Diabre, an economist, opted for an international career but also served at home as minister of economy and finance. He at one point joined the United Nations Development Programme with support from Compaore.

Kabore worked side-by-side with Compaore for 26 years - serving as premier, parliament speaker and CDP party chief - before falling out of favour and quitting the ruling party months before the collapse of the regime.

Kabore was already crowing victory. "It's going to be a first-round knock-out," he predicted. "The priority is good governance along with justice."

Polls are due to close at 1800 GMT. The electoral commission says provisional results should be known by Monday evening.