Nairobi, Kenya (CNN) -- Vote counting began here Monday after largely peaceful elections in which millions of voters stood in line to choose their next president in a tightly contested general election.
The Elections Commission said some of the nation's 30,000 polling stations would remain open late to accommodate those still in line and to make up for having opened late.
"Definitely, there is going to be some hiccups here and there, but I think, when you assess the whole, then we think the work, so far, is very good," said Abdullahi Sharawi, a commisssioner of Kenya's Independent Electoral and Boundaries Commission. "I think all Kenya, it looks like they have faith in the system, in the new constitution."
Though some people waited in the sun for more than eight hours to cast their ballots, there was "no reporting at all" of intimidation, said John Stremlau, the Carter Center vice president for peace programs. The center, at the invitation of Kenyan authorities, placed 60 observers in all 47 counties.
In Nairobi, some lines stretched for more than a kilometer (0.6 miles), he said.
But the observers' initial reports were "universally complimentary to the citizens of this nation in showing their determination to have their votes counted," Stremlau said.
Those glitches that did occur appeared related to a new system of computer-based biometric identification of voters, he said. "Sometimes a couple of computers would get kind of out of whack and would slow the process down," he said.
Residents were eager to avoid a repeat of the last election, in December 2007, when the nation plunged into ethnic violence after results were disputed. Some 1,200 people were killed and 600,000 displaced.
"There have been so many steps and safeguards put into the system so far to prevent that kind of cataclysmic event that we're kind of encouraged that that is not going to happen," said Stremlau. Carter Center observers were not in the country during the 2007 vote.
Hours before the polls opened, a group of heavily armed men attacked a police post in the port city of Mombasa, killing at least 10 people, including two police officers, officials said.
David Kimaiyo, inspector general of Kenyan police, said a group of men approached police officers manning a post between 9 p.m. and 10 p.m. and refused to comply with orders to stop. Police fired on the men, who fled into a nearby slum, he said.
When police called for backup, about 200 men ambushed them on a road, Kimaiyo said.
Prime Minister Raila Odinga blamed the attack on the Mombasa Republican Council, a separatist group that wants Mombasa, the second-largest city in Kenya, and its surrounding coastal area to secede.
Stremlau said the violence may have been unrelated to the election.
Party agents representing the two main coalitions contesting the elections will let observers and everyone else know if they have concerns about the violence being linked to the election, Stremlau said. "They can be adjudicated by the courts, as needed," he said.
Elsewhere, ETV correspondent Soni Methu told CNN that her crew came across the bodies of five people at a polling station in the coastal town of Kilifi. Two of the bodies were wearing police uniforms; one had on a Kenya Wildlife Service uniform, Methu told CNN.
In Mandera -- near the border with Somalia and Ethiopia -- witnesses said bombs exploded at two polling stations. Red Cross Mandera Coordinator Abdi Ahmed said three people were slightly wounded.
And in the Kenyan town of Kitengela, south of Nairobi, at least 20 people were hospitalized after a stampede at a polling station, CNN affiliate NTV reported.
But voting in the rest of the country was largely peaceful. "We want a leader who would be mindful of people who are living below the poverty line," one enthusiastic young man told CNN as he waited for his turn to vote. "You see, the majority of Kenyan people live below the poverty line, so we want a leader who will be mindful of these people."
The stakes are high. After the 2007 election, the government boosted security and set up an ambitious new constitution, making this election one of the nation's most complicated polls since the country gained independence from Britain in 1963.
Eight contenders are vying for the presidency, including front-runners Odinga, the prime minister; and his deputy, Uhuru Kenyatta.
Polls show a tight race, raising the possibility of a second round of voting. Kenya's constitution calls for a runoff within a month of the results if no candidate gets more than half of the vote.
After the last election, the nation also revamped various political systems, including the constitution, the electoral process and the judicial system. The new system aims to empower citizens and local governments, thereby ensuring a peaceful election.
"It is one thing to change the constitution, but we have to change our underlying issues of ethnic sentiments that have dated years," said Mark Kamau, who lives in the capital, Nairobi.
After the last election, Odinga disputed results that declared the winner to have been the incumbent president, Mwai Kibaki. Odinga alleged the election had been rigged.
Protesters took to the streets, where supporters of both camps fought one another. More than 1,200 people were killed and hundreds of thousands displaced -- the worst violence since the nation gained independence.
Optimistic, but prepared
Leading up to this election, the candidates declared they would settle any election disputes in court.
Candidates have implored their supporters to avoid bloodshed, no matter the vote's outcome.
But some citizens remained wary.
"I don't know what possessed people last time," Kamau said of the violence. "I hope there will be no violence. I'm waiting for Kenya to restore my faith this time."
But as he waits, he is prepared. His refrigerator is stocked and his car is filled with fuel.
"Just in case," he said. "You never know."
'My main issue'
The economy, security and the fight against corruption, which is rampant in the country, are among voters' top concerns in the election.
The election also poses a challenge: Kenyatta has been indicted by the International Criminal Court for allegedly inciting a local militia to conduct reprisal attacks in the last election. He has denied the charges.
His running mate, William Ruto, also faces ICC charges.
Though Kenyatta nevertheless enjoys widespread popularity, some voters expressed fear that the international community will isolate the nation if a candidate facing ICC charges is elected.
Dominic Muia, 35, was in line at 5 a.m. to cast his ballot in the town of Nakuru.
"My main issue is the economy," he said. "I'm voting for Uhuru (Kenyatta) because he is younger and has a better vision to move the country forward."
At 51, Kenyatta would be the youngest Kenyan president ever. Odinga is 68.
'Things an average citizen worries about'
Harrison Mario, 37, said his vote is based on issues and policies, and will go to Odinga.
"Basically, he has been fighting inequality." he said. "He has been campaigning for the less fortunate. His manifesto focuses on security, education and food -- things an average citizen worries about."
Both leaders are campaigning on almost the same policies, leaving the more than 14 million registered voters to choose based on criteria that include personality, ethnicity and links to political parties.
"I don't know that much about their differences, so I'm voting for the candidate of my favorite political party," said Susan Kamau, who lives in Nairobi. "In short, I'm voting on loyalty to my party, not issues."
In addition to the presidential race, the nation will also pick governors, senators and a slew of other local candidates under the new constitution.
Whoever wins, the race evokes memories of a political dynasty.
Kenyatta's father was the nation's founding president, while Odinga's father was his vice president in the 1960s.
Both started out as allies in the fight for independence from Britain, but they had a falling out that led Jomo Kenyatta, a member of the Kikuyu tribe, to force out Jaramogi Odinga, a Luo tribe member, as his vice president.
Their history has strained relations for decades between Kikuyus and Luos.
Nima Elbagir and Lillian Leposo reported from Nairobi, Nic Robertson reported from Mombasa, Faith Karimi reported and wrote from Atlanta.