NAIROBI, Kenya (AP) -- Kenyans on Tuesday voted in large numbers in an election that pits President Uhuru Kenyatta against challenger Raila Odinga in this East African economic hub known for its relative, long-term stability as well as the ethnic allegiances that shadow its democracy.
Voters formed long lines at many polling stations before dawn, waiting for the chance to cast ballots in the tightly contested race for the presidency as well as for more than 1,800 elected positions, including governors, legislative representatives and county officials. A key concern was whether Kenya would echo its 2013 election, a mostly peaceful affair despite opposition allegations of vote-tampering, or the 2007 election, which led to violence fueled by ethnic divisions that killed more than 1,000 people.
Kenyatta, the 55-year-old son of Kenya's first president after independence from British colonial rule, campaigned on a record of major infrastructure projects, many backed by China, and claimed strong economic growth. Odinga, 72, is also the son of a leader of the independence struggle and has cast himself as a champion of the poor and a harsh critic of endemic corruption in many state institutions.
However, many voters are expected to vote along ethnic lines. President Kenyatta is widely seen as the candidate of the Kikuyu people, the country's largest ethnic group. Odinga is associated with the Luo voting bloc, which has never produced a head of state.
More than 300 people, including ethnic Maasai draped in traditional red blankets, waited for hours in the dark before polling station opened in the Rift Valley town of Il Bissil. Kenyan television also showed long lines of voters in the port city of Mombasa.
"This is a positive feedback for us," polling official James Njaya said of the high turnout in Kibera, a poor area in Nairobi, the Kenyan capital.
Like many Kenyan voters, 34-year-old Fred Nyakundi arrived at a polling station several hours before it opened and waited in line in the dark before casting his vote.
"The exercise is very slow, but I am happy with the service I got," said Nyakundi, who owns a carpentry business in Nairobi. "I am going home to open the business and wait for results."
Another voter, 41-year-old Fatuma Ramadhan, thought the voting procedure was speedy. She was able to vote at 6 a.m., when polling stations opened, and then opened her restaurant to serve breakfast to other voters
Reaction to the result could partly depend on the performance of Kenya's electoral commission, which will collect vote counts from more than 40,000 polling stations. Fears of violence were increased by the murder of an electoral official in charge of technology days ahead of the election.
The election commission has said that about 25 percent of polling stations won't have network coverage, meaning officials will have to move to find a better signal and transmit results by satellite telephones. By law, election officials have up to a week to announce results, though many analysts believe the outcome of the presidential race will be declared far sooner, possibly within one or two days.
The winner of the presidential race must get more than 50 percent of the votes as well as one-quarter or more votes in at least 24 of Kenya's 47 counties, according to election officials. If the front-runner falls short of those benchmarks, the two top contenders will contest a run-off vote.
President Kenyatta and challenger Odinga also faced off in the 2013 election. Kenyatta won by a thin margin, with just over 50 percent of the vote; Odinga alleged voting irregularities and took his case to Kenya's highest court, which ruled in Kenyatta's favor by validating the results.
Kenya has nearly 20 million registered voters out of a population of more than 40 million.
Former U.S. Secretary of State John Kerry is among thousands of observers in Kenya for the election. The European Union has also dispatched monitors. Former South African President Thabo Mbeki is leading an African Union delegation.
In a speech late Monday, Kenyatta appealed to Kenyans to vote peacefully in large numbers.
"How you have voted should not in any way reflect or change the manner in which you have related to your neighbor," Kenyatta said. "Shake their hand, share a meal and tell them, 'Let us wait for the results,' for Kenya will be here long after this general election."