The cadets, who were on holiday leave for Christmas, failed to inform their superiors of their travel plans to Turkey and did not receive the necessary authorization.
The incident occurred at the Hagia Sophia, a UNESCO World Heritage site that was controversially converted into a mosque by the Turkish government in 2020.
The cadets were spotted displaying the flags by members of Turkey's National Intelligence Organization (MIT) and arrested for violating Turkish laws regarding foreign symbols.
Following diplomatic intervention, the cadets were released and returned to Greece.
They now face disciplinary action for failing to obtain permission for their trip and for their actions in Istanbul.
The incident has sparked debate about freedom of expression and the sensitivities surrounding the Hagia Sophia, a site of significant religious and historical importance for Hellenism.