Nairobi, Kenya (CNN) -- Kenya marked the signing Friday of a new constitution expected to usher in major change, though the celebration swirled with controversy when Sudanese President Omar al-Bashir, wanted for war crimes, joined the ranks of African leaders in attendance.
Al-Bashir is wanted by the International Criminal Court in The Hague, Netherlands, on allegations of war crimes and genocide in western Sudan's Darfur region, where violence that erupted in 2003 has left at least 300,000 people dead.
Kenya, a signatory to the criminal court treaty, is obligated to hand over al-Bashir.
"The Republic of Kenya has a clear obligation to cooperate with the court," said a document filed by the court prosecutor's office Friday, adding that the court was informing the U.N. Security Council of al-Bashir's presence in Kenya.
Al-Bashir was invited to the celebrations in Nairobi by the Kenyan foreign ministry in his capacity "as the head of a friendly, neighboring country," said the spokesman for Prime Minister Raili Odinga.
But the spokesman told CNN that he was "shocked" at al-Bashir's presence and that his attendance was "out of the blue." He also said that he had not spoken to Odinga but described the situation that developed as "impossible."
Asked about Kenya's obligations to the international court to arrest al-Bashir, the spokesman said he did not think the Sudanese leader would be arrested on Kenyan soil.
Human Rights Watch scolded Kenya for allowing al-Bashir to enter the country, saying that the wanted leader's presence would "forever tarnish the celebration of its long-awaited constitution."
Pro-government militias known as the Janjaweed stand accused of ethnic cleansing in Sudan's Darfur region. Al-Bashir has denied that he helped armed the militias.
Al-Bashir has traveled to several countries since the warrant was issued, including a recent trip to Chad. Friday he was among thousands of Kenyans at the signing of the new constitution three weeks after voters overwhelming approved the referendum.
Debates over a new Kenyan constitution had spanned two decades, but intensified after postelection violence left more than 1,000 dead in 2008.
"For the last two decades, the people have yearned for a new constitution," President Mwai Kibaki said.
Kibaki signed six copies of the constitution and held one up as the crowd erupted in cheers during the signing event at a park in the capital, Nairobi. The signing was followed by the national anthem and a 21-gun salute.
Changes to the constitution include a more decentralized political system that minimizes the president's powers. It also calls for land reform and allows dual citizenship -- a popular issue with Kenya's large diaspora community.
CNN's David McKenzie contributed to this report.