The two suspects were arrested on April 19 and confessed to spying on Arab nationals, a senior Turkish official said at the time.
Turkey was investigating whether the arrival in the country of one of them was related to the murder of Saudi journalist Jamal Khashoggi.
The justice ministry official said that the suspect hung himself but did not provide further details.
One of the two men arrived in Turkey in October 2018, days after Khashoggi was murdered inside Saudi Arabia’s consulate in Istanbul, the official said at the time of their detention.
The official added that the other had arrived later to help his colleague with the workload.
The two men were charged with international, political and military espionage and sent to Silivri prison, west of Istanbul, according to state-owned Anadolu news agency.