TORONTO — A former Canadian diplomat has been detained while visiting Beijing amid a dispute between the two counties over Canada’s arrest of a Chinese executive at the request of the United States.

Canadian Public Safety Minister Ralph Goodale on Tuesday confirmed the detention and said Canada is very concerned.

Michael Kovrig, who previously worked as a diplomat in Beijing, Hong Kong and the United Nations, was taken into custody Monday night during one of his regular visits to Beijing, said the International Crisis Group, for which Kovrig now works as North East Asia adviser based in Hong Kong.

The detention came after China warned Canada of consequences for its recent arrest of Huawei executive Meng Wanzhou at Vancouver’s airport. A Canadian judge granted Meng bail Tuesday while she awaits possible extradition to the U.S.

“We’re deeply concerned,” Goodale said in response to a question about Kovrig. “A Canadian is obviously in difficulty in China … We are sparing no effort to do everything we possibly can to look after his safety.”

Goodale said there was no explicit indication at this point that it was related to the Meng arrest.

However, Guy Saint-Jacques, a former Canadian ambassador to China, said he had no doubt Kovrig was detained in relation to the arrest of the Huawei executive.

“In China there is no coincidence,” he said. “Unfortunately Canada is caught in the middle of this dispute between the U.S and China. Because China cannot kick the U.S. they turn to the next target.”

Prime Minister Justin Trudeau said Canada’s government has contacted Chinese officials about the detention. “We are engaged with the file (case), which we take very seriously,” he said.

The International Crisis Group, a non-governmental organization, said it was doing everything possible to obtain additional information about Kovrig’s whereabouts.

The organization said Kovrig has been one of its full-time experts since February 2017. Its website says Kovrig previously worked as a Canadian diplomat in Beijing and Hong Kong and at the United Nations.

Saint-Jacques, the former ambassador, said Kovrig was on leave from the embassy. He said Kovrig did deep political work when he was working for the embassy. That work would include travel and interviews with dissidents, he said.

“In China there’s a very line between espionage and political reporting,” he said.