ATHENS (Reuters) - A Greek appeals court has sentenced a man who worked for a Turkish consulate to five years in prison on spying charges, legal sources said on Friday, in a case that had strained relations between the NATO allies.

The man, a Greek national employed with the Turkish consulate on the island of Rhodes, was arrested in 2020.

He had denied any wrongdoing and Turkey's foreign ministry had condemned the arrest, saying it violated the then consular official's rights.

A second Greek national, who worked as a cook on a passenger ship operating the Rhodes-Kastelorizo line, and who was arrested at the same time, has also been sentenced to three years in prison. He had also denied any wrongdoing.

Kastelorizo is a small Greek island just off the Turkish coast.

The two had been under surveillance for months before their arrest and they were accused of photographing the movements of Greek armed forces in the Aegean Sea.

Greece and Turkey have long-running issues that divide them, ranging from the divided island of Cyprus to exploration rights in the Aegean and Mediterranean Sea.

In December, both countries agreed to reboot their relations, establishing a roadmap designed to usher in a new era of closer ties between them.

(Reporting by Yannis Souliotis and Renee Maltezou; Editing by Frances Kerry)