SAKRAN, Turkey — A Turkish court on Wednesday ordered an American pastor accused of espionage to remain incarcerated, ignoring pleas for his release from his lawyer and the United States government.

In a sign that tensions between Turkey and the United States have not eased, the court ordered the pastor, Andrew Brunson, to stay in jail until his next hearing, in October. By then, he will have been detained for two years.

Mr. Brunson, who has done missionary work in Turkey for the past 23 years, is on trial on charges of terrorism and espionage — one of 20 American citizens who have been prosecuted under a government crackdown since a failed coup in 2016.

The White House and members of Congress have raised Mr. Brunson’s case personally with Turkey’s president, Recep Tayyip Erdogan, including most recently in a phone call by President Trump. American officials had hoped the pastor’s release would signal an improvement in the fraught relations between the countries.