Two alleged Isis supporters who were born on Germany are to be deported from the country in the first such expulsion in history.

The men, who hold Algerian and Nigerian citizenship, were arrested on suspicion of planning an imminent terror attack after a gun and Isis flags were found at their homes during police raids in Göttingen.

They have not been prosecuted and the allegations have not been tested in a criminal court, but federal judges upheld their planned deportation, bolstering government plans to expel more foreign nationals believed to be terror threats.

Confiscated weapons and an Isis flag seized in Gottingen, Germany, by police investigating Algerian and Nigerian men suspected of planning a terror attack (AFP/Getty Images)

Boris Pistorius, the interior minister for Lower Saxony, said the move sent a “nationwide signal to all fanatics, that we will give not even a centimetre for their inhuman plans”.

“They will be met with the full severity of means at our disposal – whether they have grown up here [in Germany] or not,” he added.

Authorities in the state adopted a new law allowing them to expel terror suspects held to be dangerous in February, amid nationwide security crackdowns following the Berlin attack.

The two unnamed suspects launched an appeal to stay their expulsion from Germany but it was rejected by the Federal Administrative Court on Tuesday.

“This has confirmed our legal position,” Mr Pistorius said. “We have applied the sharpest sword of law governing foreigners to avert a concrete danger and I am satisfied that the court agrees with our assessment.”

The men, who hold Nigerian and Algerian citizenship through their parents, were described as having an extremist Salafist background.

They were arrested in February when investigators found two weapons, at least one of them a firearm that required no permit but had been altered to fire live ammunition.

Police chief says Germany 'on high alert' after attack

Ammunition was also discovered alongside flags of the so-called Islamic State and a machete, with counter-terror police seizing computers and other evidence.

Lower Saxony's state government said they will be transported before Easter and could also be banned from returning to Germany for life.

In order for them to be legally deported, the German government must ensure they will not face torture or persecution abroad, and it was unclear whether appeals could be launched in higher courts.

A claim could also be launched using European human rights laws including the right to a family life, as the men are understood to have lived their entire lives in Germany and have few links to their parents’ homelands.

Prosecutors concluded that the two had discussed an attack plan but had no concrete plans to carry one out.

Nevertheless, the government decided to deport them, relying for the first time on measures that were part of tightened anti-terrorism laws passed after the September 11 attacks in the US.

Terrorism in 2016: Terror attacks in Europe claimed by Isis Show all 9 1 /9 Terrorism in 2016: Terror attacks in Europe claimed by Isis Terrorism in 2016: Terror attacks in Europe claimed by Isis Policemen outside Rouen's cathedral during the funeral of Jacques Hamel, the priest who was killed in a church in Saint-Etienne-du-Rouvray in Normandy on 26 July during a hostage-taking claimed by Islamic State group Joel Saget/AFP/Getty Images Terrorism in 2016: Terror attacks in Europe claimed by Isis Two jihadists, both 19, slit Hamel's throat while he was celebrating mass in an attack that shocked France as well as the Catholic Church Joel Saget/AFP/Getty Images Terrorism in 2016: Terror attacks in Europe claimed by Isis Muslims place flowers and hold a minute of silence in front of the church if Saint-Etienne-du-Rouvray, western France, where French priest Jacques Hamel was killed on 26 July Charly Triballeau/AFP/Getty Images Terrorism in 2016: Terror attacks in Europe claimed by Isis Two people hold each other by the new makeshift memorial in Nice, in tribute to the victims of the deadly Bastille Day attack at the Promenade des Anglais Valery Hache/AFP/Getty Images Terrorism in 2016: Terror attacks in Europe claimed by Isis The Islamic State group claimed responsibility for the truck attack that killed 84 people in Nice on France's national holiday. Mohamed Lahouaiej-Bouhlel, 31, smashed a 19-tonne truck into a packed crowd of people in the Riviera city celebrating Bastille Day Valery Hache/AFP/Getty Images Terrorism in 2016: Terror attacks in Europe claimed by Isis Police work at a site where a Syrian migrant set off an explosive device in Ansbach, southern Germany, on 25 July, killing himself and wounding a dozen others Daniel Roland/AFP/Getty Images Terrorism in 2016: Terror attacks in Europe claimed by Isis A Syrian migrant set off an explosion at a bar in southern Germany that killed himself and wounded a dozen others in the third attack to hit Bavaria in a week. The 27-year-old, who had spent a stint in a psychiatric facility, had intended to target a music festival in the city of Ansbach but was turned away because he did not have a ticket Friebe/AFP/Getty Images Terrorism in 2016: Terror attacks in Europe claimed by Isis Police officers walk along train tracks in Wuerzburg southern Germany on 19 July, a day after a man attacked train passengers with an axe. German authorities said they had found a hand-painted IS flag among the belongings of the man, an asylum seeker from Afghanistan, who seriously injured four members of a family of tourists from Hong Kong in his rampage Daniel Roland/AFP/Getty Images Terrorism in 2016: Terror attacks in Europe claimed by Isis German police killed a teenage assailant after he attacked passengers on a train in Wuerzburg, southerg Germany with an axe and a knife on 18 July, seriously wounding three people Karl-Josef Hildenbrand/AFP/Getty Images

It would be the first time German-born terror suspects are deported from Germany, following a series of cases against foreign citizens including asylum seekers who have arrived since the start of the refugee crisis.

Angela Merkel’s government was criticised for failing to remove terror suspects swiftly enough after revelations an attempt to deport the Isis supporter who killed 12 people in the Berlin Christmas market attack had failed.

Anas Amri was investigated over a previous alleged plot and put under surveillance for several months but missing paperwork meant he could not be sent to Tunisia after his asylum application was rejected in June.

He was released from detention after the maximum period allowed by German law and moved freely around the country using fake identities before carrying out his attack.

Following two previous Isis-inspired terror attacks that hit Germany in July, the interior minister drew up proposals to boost security, including a new focus on deporting foreigners deemed dangerous and stripping dual nationals who fight for extremist groups of their German citizenship.