The Mar Mattai monastery clings to the side of a steep mountain, and on a clear day a visitor can stand against its fortresslike walls and discern far below the winsome farmlands of Upper Mesopotamia. Here, in the cradle of civilization, the building is one of the oldest Christian monasteries in the world. From this peaceful perch, it is difficult to imagine the horror.

One hazy morning last spring, Harry Schute, a retired Army colonel in his 50s with a Cheshire grin, walked through the monastery’s heavy doors and along its shaded arcades. A boy played with a soccer ball in the courtyard, the boom of each kick cracking off the stone walls. At its peak in the 9th century, the monastery housed as many as 7,000 monks. Today it has five, a bishop, this boy and his family — all survivors of the Islamic State.

We were on the western fringes of Kurdistan, a Netherlands-size, semiautonomous region in the north of Iraq that is home to 5.2 million of the world’s estimated 30 million Kurds, a stateless people who populate the border regions between Iraq, Turkey, Iran and Syria. The fact that the monastery still stood; that this Christian boy and his family were still alive; that a small group of North Americans now felt safe enough to travel here — all of it seemed like a miracle.

Mosul, Iraq’s second largest city, one of the most dangerous cities in the world, sat 20 miles southwest. In June 2014, ISIS overran it and the group’s leader, Abu Bakr al-Baghdadi, stood inside its Great Mosque of al-Nuri and named himself caliph of the terrifying regime. By August 2014, ISIS’ ominous black flags snapped just three miles from where I now stood. Under the cover of night, the monastery’s manager, a priest named Yousif Ibrahim, whose brother had already been murdered by the militants, spirited away scores of ancient documents, the last of the monastery’s once magnificent library, and even a discolored hand bone fragment believed to have belonged to St. Matthew the Hermit, who founded the monastery in 363 A.D. He was certain the monastery would be lost. But then the airstrikes began and the Kurdish Peshmerga and Iraqi Army turned the tide on the ground. The caliphate began to crumble.