ANKARA (Reuters) - Turkey has arrested two suspects who confessed to spying on Arab nationals for the United Arab Emirates, and is investigating whether the arrival in Turkey of one of them was related to the murder of Saudi journalist Jamal Khashoggi, a senior Turkish official said on Friday.

FILE PHOTO: A demonstrator holds a poster with a picture of Saudi journalist Jamal Khashoggi outside the Saudi Arabia consulate in Istanbul, Turkey October 25, 2018. REUTERS/Osman Orsal/File Photo

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, adding the other had arrived later to help his colleague with the workload.

“We are investigating whether the primary individual’s arrival in Turkey was related to the Jamal Khashoggi murder,” said the official, adding the person had been monitored for six months before the arrests in Istanbul on Monday.

“It is possible that there was an attempt to collect information about Arabs, including political dissidents, living in Turkey.”

A Turkish court ruled on Friday evening to keep the two suspects in custody on international, political and military espionage charges, state-owned Anadolu news agency reported.

State broadcaster TRT Haber published photos of the two suspects in custody, standing in front of the Turkish flag. They also released photographs, apparently taken previously and covertly, of the two men walking down a street together.

Khashoggi, a Washington Post columnist and critic of Saudi Crown Prince Mohammed bin Salman, was killed in the consulate on Oct. 2 by a team of Saudi operatives, provoking an international outcry.

The CIA and some Western countries believe the Crown Prince, Saudi Arabia’s de facto ruler, ordered the killing, which Saudi officials deny. The Saudi public prosecutor has indicted 11 unidentified suspects, including five who could face the death penalty on charges of ordering and committing the crime.

A representative of the UAE’s foreign ministry could not immediately be reached for comment at the weekend.

A spokesman for Turkey’s interior ministry declined to comment. An Istanbul police spokesman confirmed it was involved in the operation.

As part of the counter-intelligence investigation, Turkish officials seized an encrypted computer located in a hidden compartment at what the official told Reuters was the spy ring’s base in Istanbul.

The official, who requested anonymity, said statements by the detained men suggested their intelligence operation targeted political exiles and students.

“We have extensive evidence of the individuals’ covert activities on Turkish soil,” the official said, calling it an “airtight” case. “They also confessed to have been employed by the UAE’s intelligence services.”

The suspected spies said they had recruited informants and paid them for information, the official added.

Turkish President Tayyip Erdogan has urged the United States to put its weight behind the investigation into the killing of Khashoggi and not to set the matter aside because of its ties with Riyadh.