Law lords have ruled against 20 anti-war campaigners who claimed they were right to take action aimed at preventing the Iraq war.
Five of the protesters are alleged to have attempted to immobilise B52s
The group had asked if a valid defence was available to peace activists who allegedly broke the law to prevent an even greater "crime of aggression".
The case centres on action taken near Southampton docks, and at RAF Fairford in the run up to the war in 2003.
The five law lords unanimously dismissed the appeals.
'Not a crime in domestic law'
Fourteen of the group, known as the Marchwood 14, are Greenpeace volunteers who say they should not have been convicted of aggravated trespass near Southampton docks because they were trying to stop an "illegal war".
The same argument was also offered by five people who entered RAF Fairford in Gloucestershire and allegedly tried to immobilise American B52 bombers which were later involved in "shock and awe" attacks on Baghdad.
They are due to stand trial separately at Bristol Crown Court later this year.
The protesters argued that a crime of aggression under international law should also be considered an offence under section three of the Criminal Law Act 1967.
But on Wednesday, Lord Bingham - one of the five law lords - dismissed that assertion, adding: "I am of the clear opinion that the crime of aggression is not a crime in the domestic law of England and Wales within the meaning of section three."
He said the protesters claimed they had acted "to impede, obstruct or disrupt the commission of that crime" by the UK or US governments against Iraq before hostilities began.
"They accordingly contend ... that they were legally justified in acting as they did," he said.
The law lords had not been asked to rule whether the UK or US had committed the international law crime of aggression, but whether "if they may have done, that would justify the appellants' otherwise criminal conduct".
He said: "It is for those representing the people of the country in Parliament, not the executive and not the judges to decide what conduct should be treated as lying so far outside the bounds of what is acceptable in our society as to attract criminal penalties."
A charge of aggression against an individual in a British court "would involve determination of his responsibility as a leader but would presuppose commission of the crime by his own state or a foreign state", he said.
This would in turn call for a decision on the "culpability in going to war" of the UK government or a foreign government, or both if they had gone to war as allies.
He argued that the courts would be "very slow" to review the exercise of the government's prerogative powers in relation to the deployment of the armed services.
He said it was "very relevant" that Parliament had not considered whether the international law crime of aggression should be adopted into British law.
Taking that step "would draw the courts into an area which, in the past, they have entered, if at all, with reluctance".
Lord Hoffmann said that to allow "the use of force in such cases would be to set a most dangerous precedent", although he accepted that civil disobedience on conscientious grounds "has a long and honourable history in this country".
He said the group's appeals and similar cases concerned with controversial activities such as animal experiments, fox hunting, GM crops and nuclear weapons "suggest the emergence of a new phenomenon, namely litigation as the continuation of protest by other means".
"They seek to cause expense and, if possible, embarrassment to the prosecution by exorbitant demands for disclosure, such as happened in this case."
Hugo Charlton, barrister for three of the Fairford protesters, dismissed those comments as "politically interesting, but I would say, legally worthless because it is not the issue which was discussed before the courts".
"For me it doesn't acknowledge the fundamental principle that actually sometimes individuals are right and the state is wrong and the state can act illegally," he said.
Carpenter Toby Olditch, from Oxford, one of the Fairford protesters, said he was "disappointed" by the judgement, but "not surprised".
Margaret Jones, from Bristol, another Fairford protester, said: "The state looks after its own and they have been doing it for hundreds of years - I'm not in the least bit surprised."
Ben Ayliffe, one of the Greenpeace campaigners, said he was also "very disappointed".
"We still strongly believe we did right thing in opposing the invasion and would do it again tomorrow if necessary, regardless of the legal consequences," he said.
Greenpeace is now calling on Parliament to act to ensure that the international crime of aggression is included in UK national law.
In earlier hearings, judges ruled that the courts cannot deal with the legality of the war, which was considered to be a political matter.
The Court of Appeal said that acting to prevent the commission of a crime could be considered as a defence, but added that in reality in cases like this "they were protests and were not attempts to prevent crimes".
The UK Government says that it did not break international law in taking action in Iraq.