However, Raila Odinga urged his supporters to boycott the second vote because he said no reforms had been made to the electoral commission since the original poll.
Correspondents say the election dispute has left Kenya deeply divided.
About 50 people are reported to have been killed in violence since the August ballot.
Raila Odinga had promised to hold a “memorial rally” in another part of Nairobi to honor those killed during the four months of political upheaval since the August vote.
According to the opposition leader, Uhura Kenyatta was elected by “just a small section of the country”.
There were scenes of chaos outside Nairobi’s Kasarani sports stadium when people without seats tried to rush in and were driven back by police with tear gas, and on horseback.
Big screens had been promised so that tens of thousands of people could watch the ceremony from outside the stadium but no screens were provided, AFP reports.
Inside the stadium itself, foreign dignitaries took up their seats in a calm, good-humored atmosphere.
Spectators were treated to musical performances and a military parade.
Ethiopian PM Hailemariam Desalegn and Rwandan President Paul Kagame are among a number of African leaders attending. Israel’s PM Benjamin Netanyahu is also expected in Kenya’s capital but for an event later in the presidential palace, the Jerusalem Post reports.
On October 26, the polls opened at 06:00 with tens of thousands of police and other security staff deployed to protect voters and polling stations.
International observers have scaled down their missions for security reasons.
According to unconfirmed reports, police have fired live rounds into the air to disperse opposition supporters in the western city of Kisumu and the Kibera area of Nairobi. Tear gas has also been used.
After casting his vote in the town of Gatundu, Uhuru Kenyatta urged people to cast their ballots so the country could move on.
He said: “We’re tired as a country of electioneering. It’s time we moved forward.”
Uhuru Kenyatta also said most of Kenya was “calm and peaceful”.
VP William Ruto has now called on the commission to declare Uhuru Kenyatta president as a result of Raila Odinga’s announcement.
The election re-run was due to take place on October 26, but Raila Odinga said on October 10: “We have come to the conclusion that there is no intention on the part of the IEBC [electoral commission] to undertake any changes to its operations and personnel… All indications are that the election scheduled for 26 October will be worse than the previous one.”
As a result, Raila Odinga said, “considering the interests of the people of Kenya, the region and the world at large” it was best that he withdrew from the race.
His coalition party believes the election will have to be cancelled as a result of his withdrawal, allowing “adequate time to undertake the reforms necessary to conduct an election that is in strict conformity with the constitution, the relevant laws and the constitution”.
However, Uhuru Kenyatta, speaking at a rally in the southern town of Voi, said: “We have no problem going back to elections. We are sure we will get more votes than the last time.”
The result of Kenya’s presidential election has been annulled by the country’s Supreme Court after citing irregularities.
The court ordered a new election within 60 days.
The election commission had declared incumbent Uhuru Kenyatta the winner by a margin of 1.4 million votes.
His opponent, Raila Odinga, said the commission was “rotten” and demanded resignations and prosecutions.
President Uhuru Kenyatta said he would respect the court’s decision but also branded the judges “crooks”.
Other elections in Africa have been annulled or canceled but this appears to be the first time on the continent that an opposition court challenge against a presidential poll result has been successful.
Chief Justice David Maraga said the August 8 election had not been “conducted in accordance with the constitution” and declared it “invalid, null and void”.
He said the verdict was backed by four of the six Supreme Court judges.
The announcement drew cheers from opposition supporters both inside and outside the courtroom.
Justice David Maraga said the election commission had failed “to conduct the presidential election in a manner consistent with the dictates of the constitution”.
He said the commission had committed irregularities “in the transmission of results”, adding that the court would provide details in a full judgment within 21 days.
Dissenting judges said that the Nasa opposition alliance – which had petitioned the Supreme Court – failed to prove claims that the polls had been rigged.
The election sparked days of sporadic protests, in which at least 28 people were killed. The vote had raised fears of major political violence – as was the case after a disputed poll in 2007.
Raila Odinga, 72, said the ruling marked “a historic day for the people of Kenya and by extension for the people of the continent of Africa”.
He said: “It is now clear that the entire [electoral commission] is rotten.
“It is clear that the real election results were never shared with Kenyans. Someone must take responsibility.”
He added: “We won the elections and we are going to win them again.”
In a TV address, President Kenyatta said that it was “important to respect the rule of law even if you disagree with the Supreme Court ruling”.
He called for calm, saying: “Your neighbor will still be your neighbor, regardless of what has happened… My primary message today to every single Kenyan is peace. Let us be people of peace.”
Uhuru Kenyatta, 55, added: “We are ready to go back again to the people with the same agenda that we delivered to the people.”
The president was more combative later at a rally of supporters in a market in Nairobi.
He referred to Justice David Maraga and his fellow judges as wakora (crooks in Swahili), saying they had “decided to cancel the election”. He warned the chief justice that as the poll had been annulled he was now the president again, not president-elect.
“Do you understand me? Maraga should know that he is now dealing with the serving president,” the president said.
“We are keeping a close eye on them. But let us deal with the election first. We are not afraid.”
After the election, international monitors from the EU, the African Union and the US had said there was no major fraud on polling day and urged Raila Odinga to concede.
On September 1, Marietje Schaake, the head of the EU Observer Mission, said the court ruling represented “a historic day for Kenya and we have always said that people who feel aggrieved should seek the path of the courts”.
She said the monitors had at the time pointed to irregularities and encouraged the Kenyan authorities to deal with them.
Marietje Schaake said the monitors were awaiting the full details of the ruling.