The pair, a 27-year-old Algerian and a 22-year-old Nigerian, were arrested last month on suspicion of planning a terror attack in GÃ¶ttingen, where they lived with their parents.
Raids on their homes uncovered a gun and a flag belonging to the so-called Islamic State group.
Charges were never brought, but the Lower Saxony interior ministry classified them as a threat to national security and requested their expulsion.
"We are sending a clear warning to all fanatics nationwide that we will not give them a centimetre of space to carry out their despicable plans," said the regional Interior Minister Boris Pistorius.
"They will face the full force of the law regardless of whether they were born here or not."
According to the ministry, this is the first time such a decision has been taken and opens up a debate around the rights of those who have committed a crime or, as in this case, are suspected of doing so, to remain in the country.
Germany, like many European states, subscribes to the idea of "jus sanguinis", where citizenship is determined by the nationalities of one or both parents but not by one's place of birth.
As such, being born in Germany provides no automatic right to remain in Germany.
However, since they had not been convicted of a crime, the Lower Saxony interior ministry had to argue that they nevertheless presented a security risk sufficient to expel them.
Rules on deportation are taken at a regional or state level.
In this case, the federal court was merely approving a request from the state's interior ministry.
The other consideration was whether deporting the men to their parents' country of origin presented a risk to their safety.
To date, there is no publicly available information on how either Algeria or Nigeria will deal with the men should the deportations go ahead.
A year ago, French President FranÃ§ois Hollande had to drop a move to strip convicted terrorists with dual nationality of their French passport and deport them, after an outcry in his own party.
Human rights groups argued that being able to take away French nationality from convicted terrorists would create two classes of French nationality and was thus in contravention of France's founding principle of equality.
Read more from Reality Check
In a sign of Germany's hardening attitude to security issues, a federal court has approved an order to deport two men suspected of planning an attack in their home town despite the fact that they have not been convicted and were born in Germany.