An RAF doctor who refused to serve in Iraq because he thought the war illegal is to go before a court martial.
The medical officer is based at RAF Kinloss in Scotland
Flt Lt Malcolm Kendall-Smith, 37, will face trial, ruled a judge advocate at Aldershot Court Martial Centre, Hants.
The officer faces five charges of failing to comply with a lawful order after refusing training and deployment to Basra, southern Iraq, last June.
Based at Kinloss, Moray, he had served in Iraq but would not return after studying legal advice to ministers.
Judge Advocate Jack Bayliss, delivering his ruling, said UK troops had full justification under United Nations resolutions to be deployed in Iraq at the time of the charges against the defendant - June to July 2005.
He added that the question of the legality of the 2003 invasion was not relevant to the court martial because it predated those charges.
The judge advocate said: "None of the orders given to the defendant in this case was an order to do something which was unlawful.
"I also conclude that it is no defence to a charge of wilfully disobeying a lawful order that the defendant believed that the order was not lawful.
"That might be a point in mitigation, but it cannot provide a defence in law... the offence is a deliberate disobedience of an order which the defendant received and understood."
Judge Advocate Bayliss also said that a "crime of aggression... cannot be committed by those in relatively junior positions such as that of the defendant".
At a pre-trial hearing last week, defence counsel Philip Sapsford QC argued Flt Lt Kendall-Smith had not wanted to be complicit in a crime of aggression.
The officer believed there was no lawful reason to enter Iraq because it had not attacked the UK, Mr Sapsford said.
"The flight lieutenant's case is that Iraq was and remains under occupation," he said.
"He is entitled to say to this tribunal, 'I hold that belief honestly and in these circumstances it's my duty to disobey these orders'."
Responding to the ruling on Wednesday, Mr Sapsford said: "My client will want to digest carefully the hurdles facing him."
The court martial is scheduled to take place in Aldershot from 11 April, and is expected to last three days.