OTTAWA -- Newly unsealed court documents are giving a window into a custody battle between a Canadian man and his American wife who were kidnapped and held hostage in Afghanistan for five years.

The family court documents detailing the dispute between Joshua Boyle and Caitlan Coleman over their three children, all of whom were born in captivity, were previously covered by a publication ban.

Coleman, who was kidnapped with Boyle while the two were backpacking in Afghanistan in 2012, sought the court's permission to leave Canada and return to the U.S. with the couple's children.

Boyle tried to prevent his wife, who is expecting a fourth child this month, from relocating and asked that his parents and sisters have access to the children.

Justice Tracy Engelking dismissed Boyle's requests in July.

Engelking gave Coleman temporary sole custody and allowed her to relocate the children to Pennsylvania, where her parents live, pending the results of the custody battle.

Boyle is currently free on bail awaiting a separate criminal trial over charges of assault allegedly perpetrated after the family was rescued in Pakistan and returned to Canada last October.

Boyle denies any wrongdoing and the charges have not been tested in court.

Boyle's lawyer Lawrence Greenspon told The Canadian Press that his client was "devastated" by the news Coleman had been allowed to leave Canada with the children.

"Joshua Boyle's primary concern continues to be the children's wellbeing and he is devastated by the court order that makes any access to his children near impossible," Greenspon said in an email.

Boyle and Coleman were taken hostage in 2012 by a Taliban-linked group while on a backpacking trip in Afghanistan.

Ottawa police arrested Boyle in late December and charged him with various offences allegedly committed after the family was rescued by Pakistani security forces in October and returned to Canada.

The charges include assault, sexual assault and unlawful confinement and are related to two alleged victims, though a court order prohibits publication of any details that might identify the victims or any witnesses.

Boyle was granted bail in June under strict conditions that include staying with his parents at their home in Smiths Falls, Ont., and wearing a GPS ankle bracelet to track his movements.

An initial evaluation found him fit to stand trial, but he underwent a fuller assessment at a mental health centre in Brockville, Ont. The confidential psychiatric assessment was completed this spring.

Boyle attended high school in Kitchener, Ont., and earned a degree from the University of Waterloo in 2005.

He was briefly married to Zaynab Khadr, sister of Toronto-born Omar Khadr, who spent years in a U.S. prison at Guantanamo Bay, Cuba, after being captured in Afghanistan.

In 2011 Boyle married Coleman, who was raised in Pennsylvania, during a lengthy trip the pair took to South America.

The following year, they set off for Russia and travelled through Central Asia for several months, winding up in Afghanistan.

The family's dramatic rescue last October made global headlines, and even led to a meeting on Parliament Hill with Prime Minister Justin Trudeau.