Germany's decision to refuse an Iranian woman a student visa for public security reasons has been supported by the European Court of Justice, in a verdict issued on Tuesday.

In 2012, Sahar Fahimian received a scholarship to undertake her doctoral studies from the Center for Advanced Security Research at Darmstadt Technical University. According to the ECJ, the subjects of her research "ranged from the security of mobile systems, including intrusion detection on smartphones, to security protocols."

The IT specialist applied for a student visa at the German embassy in Tehran but was refused over security concerns.

Fahimian holds a Master of Science in information technology from the Sharif University of Technology. The Iranian university is the subject of EU sanctions because of its support of the country's government, particularly relating to its military activities.

Following the denial, Fahimian brought an action before the Verwaltungsgericht, the Administrative Court in Berlin. The German government said it was worried that knowledge Fahimian would acquire during her doctoral research in Germany could be abused upon return to Iran.

It argued that given security concerns about Sharif University, she could use her education for purposes such as "the collection of confidential information in western countries, internal repression, or more generally in connection with human rights violations."

The Administrative Court then turned to the EU's highest judicial body to confirm it had the scope to reject Fahimian's visa application on these grounds, without interfering with the bloc's directive to support the EU as a "world center of excellence for study and professional training, by promoting the mobility of students".

The Luxembourg judges conceded that national authorities have great latitude in determining the security risks of student visa applications.

"While the national authorities enjoy a wide discretion as regards the existence of a threat to public security, the decision to refuse a visa must nevertheless state proper reasons," the court said.

The German judiciary must now conclude the case in the light of Tuesday's judgment.