* More than 2,000 killed in militant violence this year
* Burkina votes in second election since 2014 revolution
* About 400,000 unable to vote because of violence (Updates with polls closing)
By Edward McAllister
OUAGADOUGOU, Nov 22 (Reuters) - Polls closed in Burkina Faso on Sunday after a presidential and parliamentary election dominated by the threat of Islamist violence that prevented voting in hundreds of villages.
President Roch Kabore is seeking a second five-year term, campaigning on achievements such as free healthcare for children under the age of five and paving some of the red dirt roads that snake across the arid West African country.
But a surge in attacks by groups with links to al Qaeda and Islamic State has eclipsed everything. The violence has cost more than 2,000 lives this year alone.
After voting in a school in Ouagadougou, Kabore told reporters: "I call on all Burkinabe to vote, whatever their leaning. It's about the democracy of Burkina Faso, it's about development, it's about peace."
The election went smoothly in the capital and there were no reports of large-scale violence elsewhere during the vote. But some polling stations in insecure eastern areas had to be closed because of threats, the electoral commission said.
"People were threatened. They told them: 'those who put their fingers in the ink can say goodbye to their finger'," the commission's chief, Newton Ahmed Barry, said at a press conference, referring to the ink marks people are given to show they have voted.
At least 400,000 people - nearly 7% of the electorate - are expected to have been unable to vote due to polling stations not opening for fear of violence, official data forecast ahead of the vote.
"Before we had peace, now we have none," said 48-year-old security guard Gilbert Alalinga at nightfall outside a polling station in Ouagadougou.
"I didn't hear of violence today, that was encouraging. I want to be able to travel to the north, the east, the south without problem," he said as children raced on bicycles in a sandy field beyond.
Election officials began counting immediately after the polls closed, chalking up each vote on school blackboards across the city.
Kabore faces stiff opposition from former finance minister and 2015 runner-up Zephirin Diabre as well as Eddie Komboigo, head of Blaise Campaore's party. Campaore was president for 27 years until a 2014 revolution.
Komboigo on Sunday joined Diabre in claiming the vote had been marred by fraud. Both vowed to challenge the results by filing a formal complaint on Monday. They have not provided evidence for their claims.
Analysts expect a tight race that could go to a second round if no candidate wins more than 50% of the vote.
Some early figures could be announced late on Sunday, but overall provisional results from the first round are expected by the middle of the week.
(Writing by Edward McAllister and Alessandra Prentice Editing by Bate Felix, Kevin Liffey, David Goodman and Frances Kerry)