The Kenyan government's appeal against a court order to arrest Sudan's president on international war crimes charges has strained the ruling coalition and will measure the judiciary's success in shaking off decades of political interference.

A Nairobi court ordered the government to carry out an International Criminal Court (ICC) arrest warrant against Sudanese President Omar Hassan al-Bashir if he sets foot in Kenya, sparking a diplomatic row between the two countries.

The ICC has charged Bashir with masterminding genocide and other war crimes during his country's Darfur conflict, accusations Khartoum dismisses.

Kenya was criticised by the ICC and the West for failing to arrest Bashir when he attended a ceremony to enact the east African country's new constitution in August last year.

The Kenyan government has said repeatedly that it will cooperate fully with the ICC but the court ruling took the government by surprise and sowed discord in the shaky coalition formed to quell 2007 post-election violence.

In the past it would have been inconceivable that the judiciary would have made a ruling that was so clearly contrary to the government policy, said London-based Patrick Mair, a Kenya analyst at Control Risks.

Analysts say the invitation to Bashir was a hint to The Hague-based court that Nairobi was unhappy with its probe of six high-profile Kenyans. They are suspected of masterminding the violence that erupted after the 2007 vote.

The invitation was a subtle indicator of resistance to the ICC. The message is: should you think about slapping arrest warrants on the Kenyan suspects, you should not expect cooperation, political commentator Kwamchetsi Makokha said.

Kenya awaits a decision in January by the ICC on whether the charges against the six will be confirmed.

PUBLIC CONFIDENCE LOW

The stakes are high. Two of the suspects, former cabinet minister William Ruto and Finance Minister Uhuru Kenyatta, son of Kenya's founding father Jomo Kenyatta, plan to run in next year's presidential election. Analysts say their chances would be seriously damaged by a trial and so Kibaki and his allies want to shield them.

If the court order to arrest Bashir is overturned, analysts said it would deal a big blow to nascent reforms at the courts.

There would be negative perceptions all around. People may end up taking matters into their own hands as it happened after the elections, because Kenyans had little confidence in the court system's independence in solving disputes, Mair said.

Foreign Affairs Minister Moses Wetangula has termed the ruling a judgment in error and advised against Bashir's arrest, while the justice minister said the court order must be obeyed pending the resolution of the appeal, which could take more than a year.

The petition may then be escalated to the newly-created supreme court chaired by Chief Justice Willy Mutunga, analysts said, predicting that the delay would test Bashir's patience.

I think this is a major test for the newly-established sense of independence in the judiciary. If the courts back down now it could be the most damaging thing that would happen, Mair said.

Nairobi argues it cannot afford to cut ties with Sudan at a time when it wants to win the backing of regional neighbours after it sent its troops into Somalia to pursue al Qaeda-linked al Shabaab rebels, who it accuses of threatening its security.

Wetangula rushed to Khartoum on a charm offensive to forestall a raft of punitive reprisals ordered by Bashir against the east African country.

Trade ties between Kenya and Sudan favour Nairobi, which exported $200 million worth of tea to Sudan last year.

COLLISION COURSE

Mutunga's public warnings to top officials to stop criticising the court ruling on Bashir has set the judiciary on a collision course with the cabinet, and has exacerbated divisions within the government. Justice Minister Mutula Kilonzo warned his colleagues to back off.

I don't agree with my colleague Wetangula. Don't malign our judges in public, Kilonzo told Reuters.

If a court issues a court order you must comply. As far as I'm concerned, one can appeal and follow the due process. We should not give Bashir the impression that he can ride roughshod over our judicial reforms while we're implementing them.

Kenya's cabinet has been riven by fault lines since it was set up. This new row has strained relations further, but has not boiled over mainly because President Mwai Kibaki and coalition partner Prime Minister Raila Odinga have publicly remained quiet on the issue.

As an ICC member state, Kenya is legally obliged to cooperate with the court and its arrest warrants. But the African Union (AU) has said its members will comply scrupulously in respecting Bashir's immunity.

The AU has accused the court of unfairly targeting African rulers, a policy analysts said was a ploy to hide from the law.

What is an African Union heads of state resolution as compared with Kenya being a signatory to the Rome Statutes which are binding?, former legislator and prominent lawyer Paul Muite said.

How can AU resolutions take precedence over our constitution? This government, like other African governments, does not genuinely want to cooperate with the ICC, he said.

(Editing by Richard Lough and Philippa Fletcher)