This is the first time in Germany's history that such a decision has been taken, said a spokesman for the region's interior ministry, quoted by the German news agency DPA.
The country, like many European states, has historically subscribed to the idea of "jus sanguinis" - citizenship is determined by the nationalities of one or both parents and not by one's place of birth.
The decision also seems to be a first step in the country's hardening anti-terrorism efforts, three months after a Tunisian national hijacked a truck and rammed it into a crowd at a Christmas market in Berlin, killing 12
The two men, a 22-year-old of Nigerian origin and a 27-year-old of Algerian descent, were arrested in a police raid on February 9th in the central city of Göttingen, the region's interior minister Boris Pistorius said.
He confirmed that the federal administration court approved the deportation order after a petition by his ministry.
The men, classified as "dangerous" by police, were known to authorities through their affiliation with Salafists.
In a series of raids, police found an Isis flag and seized a gun in Göttingen where both men lived with their families.
However, police could not determine whether the suspects intended to use the firearm in a possible terror plot. Investigators then declined to pursue criminal proceedings.
The men will likely be deported quickly and will be barred from Germany indefinitely, DPA reported.
Germany has remained on high alert since the December 19th attack by Anis Amri in Berlin that also injured 56 people.
Four days after the attack, Amri, 24, was shot dead by Italian police after travelling through several European countries before heading to Milan.
The rampage in Berlin was claimed by the Islamic State group, which released a video in which Amri is shown pledging allegiance to Isis chief Abu Bakr al-Baghdadi.
Germany had rejected Amri's asylum application half a year earlier, but he could not be expelled because of Tunisian bureaucratic delays.
That led German Chancellor Angela Merkel to urge North African states to step up border controls and expedite procedures to repatriate migrants whose asylum applications are rejected.