Late last year, Mr. Marczak was contacted by Rori Donaghy, a London-based journalist who writes for the Middle East Eye, an online news site, and a founder of the Emirates Center for Human Rights, an independent organization that tracks human rights abuses in the Emirates. Mr. Donaghy asked Mr. Marczak to examine suspicious emails he had received from a fictitious organization called the Right to Fight. The emails asked him to click on links about a panel on human rights.

Mr. Marczak found that the emails were laden with highly customized spyware, unlike the off-the-shelf varieties he has become accustomed to finding on the computers of journalists and dissidents. As Mr. Marczak examined the spyware further, he found that it was being deployed from 67 different servers and that the emails had baited more than 400 people into clicking its links and unknowingly loading its malware onto their machines.

He also found that 24 Emiratis were being targeted with the same spyware on Twitter. At least three of those targeted were arrested shortly after the surveillance began; another was later convicted of insulting Emirate rulers in absentia.

Mr. Marczak and the Citizen Lab plan to release details of the custom Emirates spyware online on Monday. He has developed a tool he called Himaya — an Arabic word that roughly means “protection” — that will allow others to see if they are being targeted as well.

Mr. Donaghy said he was frightened by Mr. Marczak’s findings, but not surprised.

“Once you dig beneath the surface, you find an autocratic state, with power centralized among a handful of people who have increasingly used their wealth for surveillance in sophisticated ways,” Mr. Donaghy said.

The Emirates have cultivated an image as progressive allies of the United States in the Middle East. Their rulers often highlight their sizable foreign aid budget and their women’s rights efforts. But human rights monitors say the Emirates have been aggressive in trying to neutralize their critics.

“The U.A.E. has taken some of the most dramatic steps to shut down individual human rights activists and dissenting voices,” said James Lynch, the deputy director for Amnesty International’s program in the Middle East and North Africa. “It is highly sensitive to its image and fully aware of who is criticizing the country from abroad.”