A Greek court has handed down a two-month suspended prison sentence to eight Turkish military personnel who fled to Greece aboard a helicopter in the hours after last week's attempted coup in their country.

All eight - three majors, three captains and two sergeant majors - received on Thursday the same sentence for illegal entry into Greece, with the recognition of mitigating circumstances of having acted while under threat.

The pilot was acquitted of an additional charge of violating flight regulations, and the other seven of being accomplices in the violation.

Erdogan: Turkish democracy is not under threat

The two-month sentence was suspended for three years, but the soldiers were being held in custody pending resolution of their asylum applications, which they filed immediately after landing in the Greek city of Alexandroupolis early on Saturday.

"They found them guilty of illegally entering Greece, but not guilty of illegally flying over Greece because the accusation of illegal flight over Greece doesn't concern military planes and helicopters," journalist Antonis Repenas, reporting from Alexandroupolis, told Al Jazeera.

"One way or the other, they will lose their lives"

Turkey has demanded the soldiers' return to stand trial for participation in Friday's coup attempt. The eight denied any involvement and have requested asylum, saying they fear for their safety amid widespread purges in Turkey in the aftermath of the attempted overthrow of the government.

"They believe that, one way or another, they will lose their lives (in Turkey)," said Vasiliki Ilia Marinaki, a lawyer representing four of the men, as they appeared in court with their faces covered.

Turkey abolished capital punishment in 2004 but President Tayyip Erdogan has told crowds of supporters chanting for the death penalty that such demands may be discussed in parliament.

"Regardless of whether the death penalty is imposed or not, they believe that in the end they will be killed," Marinaki said.

Turkey, on the other hand, has branded the men "traitors" and "terrorist elements" and has asked Greece to extradite them. Greece says it will examine their asylum requests quickly. The soldiers will appear before immigration authorities on July 27 for the second time for interviews.

"We were unaware of the coup attempt"

During Thursday's court proceedings, all testified that they were crew members of three helicopters and had been unaware that a coup attempt was under way. They said they had been tasked with transporting wounded soldiers and civilians and that their helicopters had come under fire from police and others on the ground.

They said they landed at a military base near a hospital and came under fire again, and were told by their unit not to return to their home base because the situation was too dangerous. After heading to another location, the personnel decided to flee for their lives in one helicopter, they said.

Turkey: Evidence given to US of Gulen's 'role' in coup

The eight said they had spent the night in a clearing in woodland, where they found out from browsing the internet on their mobile phones that an attempted coup had taken place and that anyone in military uniform was being detained.

After debating on whether to flee to Bulgaria, Romania or Greece, they decided on the latter.

A Greek policeman also testifying in the trial said all eight were unarmed and cooperative after landing. They offered no resistance to arrest, surrendered immediately and asked for political asylum, the policeman said.