NAIROBI, Kenya – Five years after more than 1,000 people were killed in election-related violence, Kenyans on Monday began casting votes in a nationwide election seen as the country’s most important — and complicated — in its 50-year history.

Police issued alerts late Sunday of impending attacks, and the violence began even before the voting. Police in the coastal city of Mombasa reported a 2 a.m. attack by a gang of dozens; early reports indicated several officers — perhaps four or five — were killed.

Multiple factors indicated violence was likely: The police said late Sunday that criminals were planning to dress in police uniforms and disrupt voting in some locations.

In addition, intelligence on the Somali-Kenya border indicated Somali militants planned to launch attacks; a secessionist group on the coast threatened — and perhaps already carried out — attacks; the tribes of the top two presidential candidates have a long history of tense relations; and 47 new governor races are being held, increasing the chances of electoral problems at the local level.

Perhaps most importantly, Uhuru Kenyatta, one of two top candidates for president, faces charges at the International Criminal Court for orchestrating 2007-08 postelection violence. If he wins, the U.S. and Europe could scale back relations with Kenya, and Kenyatta may have to spend a significant portion of his presidency at The Hague.