OTTAWA (Reuters) - Canadian immigration officials are using DNA testing and ancestry websites to try to establish the nationality of migrants, the Canada Border Services Agency said on Friday.

CBSA spokesman Jayden Robertson said the agency uses DNA testing to determine identity of “longer-term detainees” when other techniques have been exhausted.

“DNA testing assists the CBSA in determining identity by providing indicators of nationality thereby enabling us to focus further lines of investigation on particular countries,” Robertson said in an email.

But the process raises concerns about privacy of data held by ancestry websites, and highlights political pressure over the handling of migrants by Canada’s Liberal government. More than 30,000 would-be refugees have crossed the U.S.-Canada border since January 2017, many saying they were fleeing U.S. President Donald Trump’s immigration policies.

A VICE News report on Thursday quoted an immigration lawyer whose client is being investigated by the CBSA using DNA and the ancestry database FamilyTreeDNA.com. In that case, the Canadian authorities were trying to deport a migrant who said he was from Liberia, speculating he was instead from Nigeria based on DNA testing and a linguistics report.

FamilyTreeDNA said in an email that it does not work directly with Canadian law enforcement and has “no knowledge of Canadian law enforcement or its border agency using the FTDNA platform for the purpose of gathering migrant DNA to determine nationality.”

Prime Minister Justin Trudeau’s government has vowed to find alternatives to the indefinite incarceration of noncitizens, who can be held without being charged if they are deemed a flight risk, a danger to the public or if their identity is unclear, according to Canada’s regulations.

CBSA’s Robertson said the agency obtains consent from clients before submitting their information to DNA websites. Robertson said it was impossible to say how many cases were being investigated using DNA and DNA websites.

“The CBSA does not publically discuss the mechanics of its investigative techniques in a public forum, as doing so could render them ineffective,” Robertson said.