A couple of weeks ago, I was preparing to head back to Turkey from Erbil, in northern Iraq. I had spent the past few days in and around the city, visiting the Kurdish peshmerga’s front lines against the Islamic State in Iraq and al-Sham (ISIS). Matt, my travel companion on this trip, had lived in the semiautonomous Kurdish region during the Iraq War, spending two years working at the American University of Iraq, in Sulaymaniyah, a neighboring city. After we checked out of our hotel, he insisted that we stop by the Citadel of Erbil. I’d never been, and he said that it’d be a crime if I didn’t see it.

With the afternoon light quickly fading, we wandered through souk Eskan, at the foot of the Citadel. Beneath a catacomb of sandstone archways, Arab and Kurdish venders at rickety shop fronts hawked tailored suits, spices, and the latest iPhone. When I spotted a baseball cap emblazoned with the Star of David, Matt explained that many Kurds had a strong affinity for Israel (solidarity among minority groups antagonized by Arabs, he surmised). Outside the souk, mixing with off-duty peshmerga lazing in outdoor cafés, we spotted several European aid workers and tourists smoking nargile and sipping chai. Then, we passed a guard, half asleep in his chair, and climbed a large stone ramp to the Citadel’s portcullis.

Designated a UNESCO World Heritage Site this past June, the Citadel of Erbil crowns a hillock in the city center. It is the world’s oldest continually inhabited settlement, dating to the fifth millennium B.C. Brick walls encircle the fortress; for many Kurds, it is a symbol of their resilience in the face of centuries of oppression. Residing within the walls is a city in miniature, a concentric circle of streets around the modest minaret of the Mulla Effendi Mosque. Until 2007, when the Kurdish regional government began restoring the Citadel, eight hundred and forty families lived within its confines. When evictions began so the renovations could take place, one family was allowed to remain, thus insuring that seven thousand years of settlement would continue uninterrupted.

Climbing the ramparts, Matt and I took in the sweeping vistas, the horizon replete with skyscrapers under construction. Since the U.S. invasion of Iraq, in 2003, Erbil has been a boomtown, attracting U.S. and other foreign investment, notably in the oil sector. It has become a beachhead of stability and progress, a promise of what a unified and peaceful Iraq could look like.

Both Matt and I had spent years in Iraq during the war—I as a marine, Matt as an educator. As we sat, surrounded by the region’s past, we began to speculate. I told Matt that being in Erbil made me imagine what it must have been like in Barcelona in 1936. The Spanish Civil War, like the current conflict in Iraq and Syria, proved a prelude to a larger ideological crisis, between communism and fascism and democracy, that defined Europe through the Second World War and through much of the twentieth century. Today, the ideological tension in the Middle East is among the Islamists, as represented by groups like ISIS; the autocratic regimes, as represented by rulers like Bashar al-Assad, in Syria, and Abdel Fattah el-Sisi, in Egypt; and the now largely defunct democratic movements that rose up during the Arab Spring.

Matt patiently listened to my theory, then asked how the Kurds fit into this construct. “I guess they don’t. They’re just our friends,” I said, knowing that “friend of the United States” is a complex role to hold during an existential crisis in the Middle East. Slowly, we wandered through the Citadel’s inner keep, passing beneath an enormous Kurdish flag—red, white, and green stripes, with a yellow sun in the center. I remembered how, two days earlier, during a trip to the front near Makmour, just outside Erbil, I had seen a few cans of rusted ammunition and some decade-old rifles that the peshmerga were using to hold the line against ISIS. Perhaps we Americans weren’t living up to our end of the bargain, as friends.

Walking down the Citadel’s ramp toward the bustling souk Eskan, we again passed the sleepy guard in his chair. His attitude mirrored everyone else’s: it seemed impossible that ISIS, despite occupying positions only thirty minutes away from the city limits, could make any real incursion into the Kurdish stronghold of Erbil. Even if the United States provided less than adequate support for the peshmerga, it seemed that they would hold the line regardless.

Having travelled extensively in the Middle East, I found it disorienting to be surrounded by Kurdish amity for the United States, instead of the animus I’d grown accustomed to in other countries. A few days before, when Matt and I crossed the Turkish-Iraqi border at Zakho, one of his former students, Dara, insisted on picking us up. Walking into Iraq with our backpacks, we immediately found Dara and a friend waiting for us, leaning against their black Audi Q7 S.U.V., a luxury car you would be unlikely to find in the war-ravaged Sunni provinces to the south. As we settled in for a four-hour drive, weaving through the Qandil mountains, Dara synched his phone with the Audi’s stereo system. Expecting the usual mismatch of Emirati pop and traditional folk songs, I was surprised when he cued up Willie Nelson’s “On the Road Again.” We continued to drive, winding into the altitudes, listening to nearly an hour’s worth of Nelson’s, “Red Headed Stranger.” When “Mammas Don’t Let Your Babies Grow Up to Be Cowboys” came on, Matt was the only one who didn’t know the words.

After generations of persecution by the Iraqis, the Turks, and others, the Kurds are known to say: “We have no friends but the mountains.” After nearly a decade of investment, facilitated by the U.S. occupation of Iraq, it seems like the Kurds can add “and the Americans” to that epithet. In the war against ISIS, the Kurds have become an important ally, providing essential combat troops to a place where a war-weary America will not send its own. But war through proxy is a dangerous game, often turning the best of friends into enemies: Afghanistan’s mujahideen, Nicaragua’s Contras.

Last week, a few days after we returned to Turkey, Matt sent me an e-mail with a single article attached. ISIS had detonated a bomb just outside the Citadel’s ramparts, the first in years, killing four and injuring twenty-two. The bomber was a local; his name was Abdulrahman al-Kurdi.