MISSISSAUGA, Ontario — When the restaurant elevator doors opened onto a crowd of people, many holding video cameras, Kevin and Julia Garratt thought they had stumbled into a wedding party.

But this was no celebration. In a flash, the Garratts were snatched by men and shoved into separate cars. They would not see each other for more than two years.

On the night of Aug. 4, 2014, the Garratts, Canadian Christian aid workers who lived in the northeastern Chinese city of Dandong, did not know they were in the hands of China’s feared Ministry of State Security. The men drove Ms. Garratt, 55, to an office building and demanded that she sign a document stating that she agreed to be investigated.

“Investigated for what?” she asked. It was only after a translator said the words “suspect” and “spy” that she understood. In another room, her husband was hearing the same chilling accusations.

Scared and bewildered, the Garratts signed. “I seriously thought they would realize they’d made a mistake, they’d say sorry, and we’d go home,” she said.

The Garratts suspect they were unwitting pawns in a gambit by the Chinese government to prevent Canada from extraditing a Chinese spy to the United States. The detention of the couple transfixed Canada and proved deeply damaging to the country’s relations with China.

The couple’s account provides a rare glimpse into the workings of China’s opaque state security system. Their interrogations may also reveal clues about the vast reach of China’s global espionage network and the lengths to which the Chinese government will go to protect it. During the couple’s monthslong detention, for example, they said, they were frequently threatened with execution or told that they would be sent to a North Korean gulag.

At a time of Ottawa’s warming relations with Beijing, the Garratts’ experience highlights the risks Canada and other nations face in engaging with China. Though they are now back in Canada, the Garratts say they do not feel entirely safe, describing a series of unnerving incidents suggesting that the Chinese government may be trying to keep tabs on them and their relatives.

“Even now we live under a cloud,” said Mr. Garratt, 56.

Until their highly publicized detention, the Garratts’ only claim to fame was owning Dandong’s top-rated destination on TripAdvisor: Peter’s Coffee House. They lived in China on and off for 30 years, raising their four children there and moving the family from Vancouver to Dandong, a gritty city on the North Korean border, in 2007. Mr. Garratt said he had wanted to address the suffering of those living across the border by providing aid to orphanages and a school for the disabled in North Korea.

Peter’s Coffee House, named for one of their sons, quickly became a hub for expatriates, local Chinese curious about the outside world — and state security agents suspicious of the Garratts and their customers, who included the occasional American or Canadian diplomat.

Ms. Garratt taught international trade and management at a local university while her husband ran the cafe, organizing weekly “English Corner” language exchanges. In their spare time, the couple volunteered around Dandong, often taking Chinese orphans ice skating.

One evening, the Garratts were invited to a restaurant dinner by Chinese acquaintances who told them that they wanted advice about how their daughter could apply to the University of Toronto.

Those supporting the Garratts say the couple were simply chess pieces in a larger geopolitical skirmish.

“The Chinese made it clear that the Garratt case was designed to pressure Canada to block Su Bin’s extradition to the U.S.,” said James Zimmerman, an American lawyer in Beijing hired by the family to lobby Canadian and Chinese government officials for their release.

Image

Some playing cards, which Julia Garratt made while she was imprisoned, are held by Julia, in Mississauga, Ontario, Canada, in December.CreditIan Willms for The New York Times

In an emailed statement about the Garratts’ detention, Global Affairs Canada, the department that handles Canada’s diplomatic relations, declined to comment on the question of an exchange, but said, “Senior government officials were raising the case at every opportunity.”

The Chinese Embassy in Ottawa denied that the Garratts’ detention was linked to Mr. Su. “We don’t think it is related to any other cases,” an embassy spokesman said in an email.

According to the Garratts’ account, after signing the investigation document Mr. Garratt was driven to the couple’s apartment, where agents ransacked their possessions, grilled him about the contents of the kitchen cabinets and then carted off schoolbooks and computers in the family’s suitcases. After a heated exchange, the men allowed Mr. Garratt to take a pair of Bibles back to the detention center.

His wife was already at the compound, an extralegal detention center on the outskirts of the city, confined to a separate isolation cell that had a couch, a bed and a small window covered in opaque plastic. During the next six months, they said, they never knew the other was there.

But neither was ever alone.

Rotating pairs of guards sat on the couch in each of their cells, staring silently at them and writing down their every move. Harsh lights remained on 24 hours a day. To stay sane, Ms. Garratt said, she prayed, read books provided by the Canadian Consulate and each day drew a cryptic picture of something she was grateful for in the back of her Bible, afraid anything written would be confiscated.

They each faced daily six-hour interrogations by a team of three men. Armed with years of emails, Skype messages and surveillance records, the interrogators accused the Garratts of “hosting” foreign diplomats at their coffee shop, taking orders from Canada’s intelligence agency and stealing state secrets, the couple said.

The agents showed them photos of United States and Canadian diplomats who had visited their coffee shop. The interrogators claimed Mr. Garratt’s photos of street scenes in Dandong and views of North Korea across the Yalu River were espionage, even though tourists on riverboat trips took the same photos every day.

Ms. Garratt was forced to write confessions detailing her every conversation with embassy officials, a difficult task considering she had spoken to many foreign customers and did not know who they were. They also made her list the names, relationships and phone numbers of people in China and Canada she had emailed, going back more than a decade.

“When they pushed really hard, they’d threaten to take my son,” she said, referring to Peter, who was studying at a university in China at the time.

Security officers used a variety of coercion tactics. “They threatened execution many times,” Mr. Garratt said with a shudder. In one exchange, the interrogators described a 2009 meeting in Vancouver between the couple and an agent from the Canadian Security Intelligence Service, who had wanted to ensure their volunteer work in North Korea was not violating United Nations sanctions. When Ms. Garratt asked how the interrogators had known about the meeting, one of them said, “We have people in the U.S., Canada, everywhere.”

Canadian officials declined to discuss the Garratts’ treatment, but the couple’s account squares with those of many people who have been in Chinese detention.

Their isolation ended as suddenly as it began. In February 2015, Ms. Garratt was released on bail and returned to their apartment. In the meantime, her husband was charged with espionage and transferred to a prison medical ward.

During the 19 months he spent there, a rumor circulated among the guards that he would be released as part of a prisoner exchange.

But in February, Mr. Su waived his challenge to extradition and cut a deal with the United States. Once that happened, “Beijing was stuck with a weak case of espionage against the Garratts and little bargaining leverage to get much of anything out of Ottawa,” said Mr. Zimmerman, the American lawyer.

In August, just days before Prime Minister Justin Trudeau of Canada arrived in China for a Group of 20 summit meeting, Ms. Garratt was allowed to leave the country. Two weeks later, Mr. Garratt was taken to court, where a judge read out an eight-page guilty verdict in Chinese; the next morning, he was put on a plane bound for Tokyo, but only after agreeing to pay more than $14,000 in fines and signing a document promising not to speak with the news media about his detention. Much of that money, he said, had been dedicated to a North Korean orphanage.

Mr. Trudeau called while Mr. Garratt was en route to Vancouver, where the family tearfully reunited. Just days later, China and Canada agreed to discuss a landmark free trade deal and an extradition treaty. The government has denied that it made any concessions to China for Mr. Garratt’s release.

Yet the Garratts do not feel entirely free. In recent months, relatives have encountered strange interference on their phones, computers have gone haywire, and strange cars parked outside their homes drive away when someone approaches.

Most of all, the Garratts feel grief at losing the lives they built over 30 years. “That’s the sadness that overwhelms us,” Mr. Garratt said. “We were just trying to help people in need. That’s all we did.”

Correction:Jan. 1, 2017

An earlier version of this article misstated the number of children the Garratts have. They have four, not three.

A version of this article appears in print on , on Page A7 of the New York edition with the headline: Canadians Held in China Are Free, but ‘Even Now We Live Under a Cloud’. Order Reprints | Today’s Paper | Subscribe