A German solider, working for his military's IT division, will be allowed to keep his rank and stay in the army after a court supported his right to refuse to develop software for possible use in the Iraq war.

When the soldier - who has not been named - refused to work on software intended for troops in Iraq because he felt the war was illegal, he was demoted from major to captain and attempts were made to kick him out of the military altogether.

However, the Federal Administrative Court in Leipzig ruled yesterday that his freedom of conscience was higher than the command of a superior.

The soldier had claimed his superior could not guarantee that the software he was developing would not be used in Iraq by German forces stationed in Kuwait, or German soldiers flying in AWACS surveillance airplanes or by US forces stationed in Germany.

The German government, under Chancellor Gerhard Schr"der, refused to commit armed forces to the US-led war in Iraq.