ISTANBUL (Reuters) - A Turkish court on Tuesday ordered the release from house arrest of a U.S. Consulate employee being tried on terrorism charges, days before a planned meeting between the two countries’ leaders.

The restriction on Nazmi Mete Canturk, a Turkish security officer at the Istanbul Consulate, was lifted on health grounds. He is on trial alongside his wife and daughter for alleged links to the network of Fethullah Gulen, the U.S.-based Muslim cleric blamed by Ankara for a failed 2016 coup.

Trials of U.S. citizens and local consulate workers in Turkey have been a main source of disagreement between the NATO allies, whose ties have also worsened in recent years over differences in policy in Syria and Ankara’s purchase of a Russian missile defense system.

Presidents Tayyip Erdogan and Donald Trump are expected to meet at a G20 summit in Tokyo Friday and Saturday and discuss Ankara’s purchase of the S-400s system.

In court on Tuesday, Canturk denied being a member of Gulen’s organization. That charge was set out in an indictment that also said he was in contact with dozens of people under investigation for membership of Gulen’s network.

Turkey considers the network to be a terrorist organization.

He said he only spoke with officials who he needed to contact as required by his job. “The people in these offices are public officials appointed by the state. It is impossible for me to know if these people had criminal records. There was no such obligation on my part,” he said.

Canturk said that in addition to having high blood pressure and diabetes, he had a heart attack in 2008 and needed to see his doctor regularly. His 17 months of house arrest has worsened his health, he said.

Taking those factors into account, the court released him from house arrest and ordered him to report to local authorities regularly during his trial.

The court also lifted control measures that required his wife Sevim and daughter Irem Canturk - who also deny the charges against them - to report to local authorities regularly. All three remain banned from traveling abroad.

The trial resumes on Oct. 2.

U.S. Charge d’Affaires Jeffrey Hovenier welcomed Tuesday’s move.

“We continue to have seen no evidence to support the charges brought against him (Nazmi Canturk), and we reiterate our call for this process, as well as other processes involving our unjustly detained staff, to be resolved quickly, transparently and fairly,” he told journalists outside the courthouse.

Canturk is the third U.S. consulate worker to stand trial. One of the three, Hamza Ulucay, was sentenced to four-and-a-half years in prison on terrorism charges but was released in January, with travel restrictions, after almost two years in detention.

Metin Topuz, remanded in custody after two sessions of a trial on espionage charges, is due to appear before a judge on Friday.