Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

One of the dozens of people killed in an attack on an Istanbul airport Tuesday was a doctor on a mission to save his son from the terror group ISIS, officials and friends said.

Fathi Bayoudh, a Tunisian military doctor and head of a pediatrics unit at a hospital in the country’s capital, had traveled to Turkey about two months ago to retrieve his son, Anouar, from Syria, a family friend confirmed to NBC News.

Anouar, who was in his late 20s, left to join the terror group ISIS and traveled first to Iraq and then to Syria, the friend said.

Fathi Bayoudh, a Tunisian doctor, was among those killed in an attack on Istanbul's international airport in Istanbul, Turkey, on June 28, 2016.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Another friend of the son posted online that Anouar had become disillusioned with ISIS and left Iraq for Syria to try and cross the border into Turkey.

"He loved his son so much," another family friend, Leyla Njim, told The New York Times. "He would have done anything for him. He went there to bring him back."

Related: Turkey Arrests 13 Over Istanbul Airport Attack

Bayoudh was working with the Tunisian Embassy in Ankara to get his son from Syria, a friend of the son said. Bayoudh called his wife, who is also a doctor, to Turkey and went to the airport to pick her up when the attack occurred, according to reports.

Bayoudh’s body was flown back to a military airport in Tunisia Thursday, the country’s minister of defense said.

More than 40 people were killed when three attackers opened fire and then detonated explosives at the airport Tuesday. Over 230 people were injured. No group has claimed responsibility, but officials have said the attack bears the hallmarks of ISIS.

Bayoudh was a career military officer and had worked on a military mission to help Libyan refugees from that country’s civil war in recent years, and in 2003 was part of a military medical mission to Algeria to help in the aftermath of a devastating earthquake there, colleagues said.

Tunisian state media reported that Anouar was in Turkish custody and was expected to be returned to Tunisia, citing an unnamed Tunisian foreign ministry official.

Sources close to his family told NBC News the family was told Anouar is in Turkish custody and they expect him to be returned to Tunis. The family believes Anouar will likely serve time in prison, as the country has a standing policy of prosecuting its citizens who leave to join foreign terrorist organizations.

Bayoudh’s wife flew back with her husband’s body Thursday. After a ceremony at the airport, hundreds — from former colleagues and military officers to strangers — offered their condolences at their home in Tunis, the a colleague of Bayoudh and who was at the home said. The colleague and military officer described Bayoudh as generous and well respected.

Bayoudh will receive a state funeral Friday and will be buried in the province of Mahdia, the government said.