Former United Nations secretary general Kofi Annan will step in to mediate Kenya's disputed presidential election, the African Union said Thursday.

In a statement, the AU said Kenyan President Mwai Kibaki and opposition leader Raila Odinga have agreed to work with a panel led by the Ghana-born Annan, who led the UN for nearly a decade, to resolve their dispute over the country's Dec. 27 election.

International observers said the election had a flawed vote count. Supporters of Kibaki and Odinga have claimed the vote was rigged, and the resulting violence has left more than 500 dead and displaced 250,000 people.

The AU made the announcement as their mediator, Ghanaian President John Kufuor, prepared to leave Kenya after failing to persuade the two leaders to meet. Odinga has said he will only meet Kibaki with outside mediation, but the president wants direct talks.

Despite the setback in AU attempts, Kufuor appeared hopeful the two sides could agree on a peaceful resolution.

"The parties agreed to work together with a panel of eminent African personalities headed by Mr. Kofi Annan … towards resolving their differences and all other outstanding issues including constitutional and electoral reforms," Kufuor told the BBC. "Both sides agreed there should be an end to the violence and they also agreed there should be dialogue."

Kibaki and Odinga have also agreed to end the violence and any other acts detrimental to resolving the conflict peacefully, the African Union said.

Allies of Kibaki were sworn in as cabinet members on Thursday, further complicating attempts for a power-sharing compromise.

Kibaki gave half of the positions to members of his own party and loyalists on Tuesday. Later that day, the government issued a statement saying there was room in the remainder of the cabinet for opposition party members.

Kufuor's spokesman, Salim Lone, called the appointments "a slap in the face" intended to undermine the AU talks. 

Meanwhile Thursday, Kenyans for Peace with Truth and Justice, a newly formed civil rights organization said an investigation found officials had rigged the election. The group demanded the prosecution of the entire 22-member electoral commission and some staff, including vote counters.

The group said commissioners and staff forged documents, subverted the rule of law, made false certificates and abused their office.

"The electoral process is so seriously flawed that, until that is redressed, and until we have truth and justice about the election, we are not going to have a viable society in Kenya," said Shailja Patel of the Kenyans for Peace.

With files from the Associated Press