In 2012, Boyle and his American-born wife, Caitlan Coleman, set out on a journey through Central Asia and were captured near the Afghanistan-Pakistan border.
Coleman was pregnant at the time. She has now given birth to three children in captivity — two boys and a girl.
On Thursday, U.S. officials said in a statement that the Pakistan army “recovered five Western hostages including one Canadian, his U.S. national wife and their three children from terrorist custody through an intelligence-based operation by Pakistan troops and intelligence agencies.”
Officials say Pakistani commandos carried out a raid and there was a shootout before they safely rescued the hostages from a van.
Boyle’s aunt, Kelli O’Brien, told Global News she was thrilled and shocked by the news.
“After all the hopes of five years, all the prayers… this time it’s actually happening,” O’Brien said.
“The children are young enough that they can live a normal life and know what family means.”
WATCH: White House says family could be transported to Canada
The High Commissioner for Pakistan to Canada said Boyle and his family were then flown by helicopter to the U.S. embassy in Islamabad, Pakistan where they remain. He said the family is fit to travel but hasn’t yet decided if they will fly to Canada or the U.S.
Another U.S. official said Boyle was nervous about being in “custody” given his background.
For five years the family was being held by the Haqqani network. U.S. officials call the group a terrorist organization and have targeted its leaders with drone strikes. But the group also operates like a criminal network. Unlike the Islamic State group, it does not typically execute Western hostages, preferring to ransom them for cash.
WATCH: Josh Boyle’s aunt describes him as ‘fierce defender of human rights’
On Thursday, U.S. President Donald Trump said Pakistan’s release of the family is a sign that “a lot of countries are starting to respect the United States of America once again.” He praised Pakistan for its willingness to “do more to provide security in the region.”
“We hope to see this type of co-operation and teamwork in helping secure the release of remaining hostages and in our future joint counterterrorism operations,” he said.
WATCH: Trump thanks Pakistan for helping to free Canadian man, family
Canada’s Minister of Foreign Affairs, Chrystia Freeland issued a statement saying she is greatly relieved about the family’s release.
“Joshua, Caitlan, their children and the Boyle and Coleman families have endured a horrible ordeal over the past five years. We stand ready to support them as they begin their healing journey. We ask that the families’ privacy be respected.”
Boyle was born in Waterloo, Ont., and his mother and father now live in Ottawa.
He met Coleman (who is from Pennsylvania) online and the couple married in 2011.
The couple set off in the summer of 2012 for a journey that took them to Russia, Central Asia and then to Afghanistan. Coleman’s parents last heard from their son-in-law on Oct. 8, 2012, from an internet cafe in what Boyle described as an “unsafe” part of Afghanistan.
In 2013, the couple appeared in two videos asking the U.S. government to free them.
Coleman’s father, James Coleman, told the Associated Press in 2012 it was possible the couple may not have realized how dangerous an area they were heading to.
“They’re both kind of naive, always have been in my view. Why they actually went to Afghanistan, I’m not sure… I assume it was more of the same, getting to know the local people, if they could find an NGO (non-governmental organization) or someone they could work with in a little way,” he told AP.
Boyle was previously married to the sister of Omar Khadr, who spent 10 years at Guantanamo Bay after being captured in 2002 in Afghanistan when he was 15.
Officials discounted any link between that background and Boyle’s capture, with one official describing it as a “horrible coincidence.”
WATCH: Parents of couple being held in Afghanistan speak out
*With files from Global News’ Nick Logan, Vassy Kapelos and the Associated Press
© 2017 Global News, a division of Corus Entertainment Inc.