NAIROBI, Kenya - Waiting in hours-long lines and in some cases queuing up well before dawn, Kenyans streamed to the polls by the millions yesterday in what was shaping up to be the most open and competitive presidential election since the country gained independence from Britain in 1963.

Although there were accusations of rigging, some questionable poll hitches, and a few incidents of violence, election day proceeded relatively calmly, if tediously, across one of sub-Saharan Africa's most stable democracies.

Supporters of the two main contenders, opposition firebrand Raila Odinga and President Mwai Kibaki, both seemed confident of victory.

Odinga has maintained a slight lead in polls, and among his followers, there was an air of victory.

Arriving to vote in his stronghold, Kibera, a sprawling, bustling slum of dirt paths, trash heaps and rusted shacks, Odinga was engulfed by jubilant crowds cheering: "Clear the way! The president is coming!" and

"Rais! Rais!"

- the Swahili word for

president

.

Odinga wore a white cowboy hat that from a distance seemed to float along a sea of flailing arms into the polling station.

"We are going to win," said Wilson Odongo, 25, who was in his fifth hour of waiting in a line that appeared to stretch half a mile. "Without any doubt."

Kibaki, an economist, campaigned on a record of strong economic growth and pledges to expand his program of free primary education to the secondary level.

Odinga, a populist known as "the warrior" for his years of campaigning for multiparty democracy, has promised even greater economic growth and to more equitably distribute wealth. He has also attacked Kibaki for failing to fight one of Kenya's most pressing problems, corruption.

The constant undercurrent of the election season, however, has been tribalism. Odinga's supporters have accused Kibaki of favoring his own ethnic group, the Kikuyu. Kibaki's supporters fear that if Odinga wins, they will suffer a backlash.

"I am very, very concerned - the situation on the ground shows there will be a negative backlash against the Kikuyu," said Peter Muchiri, a construction company sales manager, referring to tension in some areas between the Kikuyus and Odinga's ethnic group, the Luo. "The perception that Kikuyus have benefited more comes out of ignorance."

With expectations high among Odinga's supporters that he would win the election, there was also a fear that if the results turn out differently, volatile areas such as Kibera might erupt in riots.

On Wednesday night, the vigilante groups that rule Kibera lit bonfires around the entrances to the slum and checked cars for anything that might suggest vote-rigging.

Those fires still smoldered in the clear air yesterday, and some of the young men guarding the roads promised that they would "go guerrilla" if Odinga did not win.

But others standing in the long lines - electricians, mechanics, fruit-sellers, cellphone vendors, corn-on-the-cob hawkers and computer technicians with hopes transcending their surroundings - said that Kenya had moved beyond that point.