* Hundreds of officers jailed in recent years
* Commander dubs conspiracy trials "shameful"
* PM has moved to distance himself from trials
By Jonathon Burch
ANKARA, Jan 30 (Reuters) - Turkey's number-two naval commander said he had resigned in protest over the "shameful" jailing of hundreds of colleagues on coup plot charges, fearing he would be the next victim.
Prime Minister Tayyip Erdogan's government has detained several hundred serving and retired officers over the past few years, including as much as one fifth of Turkey's top military chiefs, on charges of conspiring to overthrow the government.
During his 10 years in power, Erdogan has brought to heel the once-supreme armed forces, which regularly interfered in politics and has carried out a string of coups in past decades.
More than 300 past and present officers were handed lengthy prison sentences in September after a 21-month trial on charges of plotting to topple Erdogan's government almost a decade ago.
Hundreds more officers are still on trial in various conspiracy cases and around 37, almost 10 percent, of the 348 generals and admirals in the Turkish armed forces are in prison, according to media reports.
"In the past few years my friends under arms, some of whom I know very closely and about whose patriotism I have never felt the slightest doubt, have been found guilty through verdicts handed down by courts in the name of the nation," said Admiral Nusret Guner, who was operational commander of the navy.
"These continuing trials, investigations and prosecutions of them ... some of whom are detained and some not, have become the biggest lesson of my life," Guner said in a farewell speech to his colleagues on Tuesday.
In his speech, excerpts of which appeared on Wednesday in the daily newspaper Vatan, Guner said he had first tried to resign on Sept. 28 last year, a week after the convictions, but had agreed to remain until January when he was legally allowed to retire.
Guner was expected to have taken over the top naval role this August when the current admiral steps down.
"When I presented my resignation to my commander, I urged for it to be accepted immediately, or else the chances of my request being heard about would increase with every passing day," Guner said.
"And as a result a series of plots involving me could be constructed," he said.
In a statement on Monday, the military general staff announced it had accepted the retirement of Guner, but did not give a reason for the decision.
POLITICAL WITCH HUNT
Erdogan, whose ruling party has moderate Islamist roots, has received praise at home and abroad for bringing the military, which sees itself as the guardian of secularism, under civilian control.
However, the years that defendants spend in prison without conviction have raised fears that the conspiracy trials are a political witch hunt aimed at silencing opposition.
Around 100 journalists are also in jail, as well as thousands of activists, lawyers, politicians and others. Most are accused of plotting against the government or supporting outlawed Kurdish militants.
As public support for the investigations dwindles, Erdogan has moved to distance himself. On Friday he criticised the lengthy pre-trial detentions, suggesting they were sapping the army's morale and affecting its ability to fight a Kurdish insurgency. (Writing by Jonathon Burch; Editing by Rosalind Russell)