At least 15 people were killed in attacks by machete-wielding gangs as Kenyans voted in a presidential election.

Just hours before the start of voting and with long queues across the east African country, at least nine security officers in Kenya's restive coastal region were hacked to death, and six attackers were also killed.

There were two separate attacks which senior police officers blamed on a separatist movement. If confirmed this would suggest different motives to those involved in the tribal bloodshed that erupted after a disputed 2007 poll. Officials and candidates have made impassioned appeals to avoid a repeat of the ethnic rampages in which more than 1200 people were killed, shattering Kenya's reputation as one of Africa's most stable democracies and bringing its economy to a standstill.

As in 2007, the race has come down to a duel between two candidates, this time between Deputy Prime Minister Uhuru Kenyatta and Prime Minister Raila Odinga, the loser in 2007 to outgoing President Mwai Kibaki. Both contenders will depend heavily on votes from tribal loyalists.

The US and Western donors are worried about the stability of a nation that is an ally in the fight against militant Islam in the region but are also fretting what to do if the victor is Mr Kenyatta, who faces charges by the International Criminal Court of orchestrating violence five years ago.

Although the two leaders are well ahead of the other six contenders, polls suggest they will struggle to secure an outright win, which could make for a tense run-off. A narrow first-round victory for either could spark legal challenges. The election commission has seven days to announce the official outcome.

Mr Kenyatta's running mate William Ruto, who also faces charges of crimes against humanity, said: "If elected, we will be able to discharge our duties. We shall co-operate with the court with a final intention of clearing our names."

One of yesterday's attacks took place outside Mombasa and another in Kilifi about 80 miles to the north. They were blamed on separatists from the Mombasa Republican Council (MRC), which wanted the national vote scrapped and a referendum on secession instead. At the Kilifi site, footage showed a piece of paper on the ground with the words: "MRC. Coast is not Kenya. We don't want elections. We want our own country." There was no formal claim and no independent confirmation of the assailants.

Even before the violence, many Kenyans were wary, notably in flashpoints last time. Some shopkeepers ran down stocks and some people in mixed tribal areas returned to their homelands.

Bernard Otundo, 36, queuing at a polling station in Nairobi, said he expected a peaceful vote. "There have been a lot of awareness campaigns against violence and I don't think it will happen this time around, whatever the outcome," he said.

However, Odinga supporter Eunice Auma, 32, said: "Should our candidate fail to clinch victory. I'm afraid violence will erupt."

Adding to the tension, the al Shabaab Islamist militant group battling Kenyan peacekeeping troops in Somalia, repeated calls on Nairobi to remove its forces, threatening retaliation.

A grenade attack on a police post in Garissa, a city near Somalia, killed two civilians and a bomb exploded in the Mandera area, also near the border, causing no fatalities. No group claimed responsibility.