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."
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.