A Russian government official is warning the government of Canada that the country will face consequences if it violated Russian law by helping homosexual Chechens escape to Canada as refugees.

The Russian government announced it would investigate claims made by Rainbow Railroad, a nonprofit organization that helps LGBTQ people escape from countries where they are persecuted by government authorities. Last week, the organization told the Telegraph that it had helped LGBTQ Chechens sneak out of the semi-autonomous republic into safe houses elsewhere in the country. They were then smuggled out of Russia and escaped to Canada.

Afterwards, Rainbow Railroad said it had worked with the Canadian Global Affairs Department and the Immigration, Refugees and Citizenship Department, to help resettle 31 Chechen refugees in Toronto.

Russian authorities were not impressed at what they saw as interference by a foreign government into domestic affairs.

“Any legal irregularities, if proven true, shall be duly investigated,” Kirill Kalinin, a spokesman for the Russian embassy in Ottawa, told The Globe and Mail in an email responding to Rainbow Railroad’s claims. He declined to elaborate on which Russian laws may have been broken, and the Canadian government has declined to comment on the matter.

Possibly exacerbating the rift between the two countries is the fact that Canadian Foreign Affairs Minister Chrystia Freeland, who is of Ukrainian heritage, was involved in creating the so-called “underground railroad” for LGBTQ Chechens. Freeland has been a longtime critic of Russia’s past human rights violations, particularly under current President Vladimir Putin — so much so that she has been banned from entering the country.

Rainbow Railroad’s efforts to resettle LGBTQ Chechens occurred after news broke in April that police in the majority-Muslim republic were detaining, arresting, torturing, and even killing men and women suspected of being homosexual or bisexual. Tens of people, mostly men, are thought to have been killed, either at the hands of government authorities or by their families in “honor killings” that are carried out with the government’s encouragement.

Since June, the Canadian government has been identifying people at risk and secretly bringing them to the country. But it is questionable whether that program violates Russian law.

Under the United Nations Convention on Refugees, a refugee is considered someone who is outside their home country and cannot return because of a “well-founded fear of persecution,” Matthew Jeffrey, a Canadian immigration lawyer, told The Globe and Mail. Under that definition, the Chechens cannot be considered refugees because Chechnya is part of the Russian Federation, which has not yet been found to be persecuting LGBTQ people.

However, Jeffrey said, “if the Canadian government is going to a foreign country with a goal of assisting people who they consider to be persecuted in that country, then they are not bound by the refugee convention.” Such efforts would be characterized as humanitarian in nature, rather than a refugee effort.