The exiled People's Mujahideen is opposed to Iran's government
The government has been denied permission to challenge an order that it take an Iranian opposition group off a list of banned terror organisations.
The Court of Appeal ruled an appeals panel was right to order the removal of the People's Mujahideen Organisation of Iran (PMOI) from the blacklist.
The appeals panel had said the PMOI was not "concerned in terrorism" for the purposes of the 2000 Terrorism Act.
Home Secretary Jacqui Smith said she was very disappointed with the ruling.
The government has said its stance was made in order to protect the public, because the PMOI has a long history of terrorism.
Ms Smith said she would consider introducing tighter legislation in order to maintain the proscription.
The PMOI is illegal in the European Union and the United States.
But the Proscribed Organisations Appeal Commission in London had ruled that ministers must remove it from their blacklist.
The British government went to the Court of Appeal, but the judges held there were "no valid grounds" for arguing the commission had made legal errors in its decision that the PMOI was not "concerned in terrorism" for the purposes of the 2000 Terrorism Act.
It is a vindication of the resistance that has been raised against the regime in Tehran
Dr Ali Safavi
National Council of Resistance of Iran
Home Officer lawyers had argued that although there had been a "temporary cessation of terrorist acts", there was reason to suspect the halt was only "for pragmatic reasons" and attacks might be resumed in the future.
But the Lord Chief Justice, Lord Phillips, sitting with Lord Justice Laws and Lady Justice Arden, said: "An organisation that has temporarily ceased from terrorist activities for tactical reasons is to be contrasted with an organisation that has decided to attempt to achieve its aims by other than violent means.
"The latter cannot be said to be 'concerned in terrorism', even if the possibility exists that it might decide to revert to terrorism in the future."
The National Council of Resistance of Iran (NCRI), of which the PMOI is a member, welcomed the decision.
After the ruling Dr Ali Safavi, of the council's Foreign Affairs Committee, said: "The home secretary must now lay before Parliament an order to remove the PMOI from the list.
"This ends a seven-year legal and political battle by the PMOI and dozens of members of both Houses of Parliament and their lawyers.
"It is a vindication of the resistance that has been raised against the regime in Tehran."
The home secretary said she was very disappointed with the ruling
The BBC's correspondent Frances Harrison said the decision would have repercussions for the EU, which bases its ban on the PMOI on Britain's stance.
She said the court ruling could even prompt the US to review its terror listing.
Speaking from Paris, the PMOI's leader Maryam Rajavi said applying the terror label to her group had been the hallmark of an era which appeased what she called the "mullah regime" in Iran.
That era, she said, was now at an end.
The PMOI, or Mujahideen-e Khalq, which operates in exile, says it has renounced violence since 2001.
A militant organisation, whose ideology combines elements of both Marxism and Islam, the group based itself in Iraq after being expelled from Iran.
For more than 15 years before the fall of Saddam Hussein, it used bases in Iraq to launch attacks against Iran.
The PMOI marked their victory by broadcasting televised celebrations from London, Paris and Iraq.