The blast wave thundered through the compound, ripping the expletive on my lips in two and cramming half of it back down my throat. The radio-room supervisor, Hassan Osman, and I stumbled to the balcony. In that cathedral-quiet moment between the detonation of the car bomb and the staccato barrage of gunfire, we knew they were coming. Shabab militants were storming the compound, squeezing off bursts from the Kalashnikovs at their hips, leaping the gate’s smoking wreckage. It was June 19, 2013.

“Dewaine. Dewaine.” Hassan’s voice was steady, his hand on my shoulder. “Do the public announcement.”

Over the P.A., I instructed the several dozen United Nations staff members to duck and cover and then tried to figure out what to do next. With every rifle crack, my world flashed in a monochrome of stark, tactical decisions, like life and death reduced to their lowest common denominators. Even in the moment, the irony of stumbling into my first firefight more than a decade after leaving the Marine Corps was not lost on me. Since leaving the military, I’d grown used to my buddies shaking their virtual heads, via social media, at the fundamental insanity of inserting yourself into war without having the good sense to engage in combat.

Mogadishu was a study in violent coexistence, a brutal ecosystem where new conflicts sprouted up without ever quelling the old. The Somali capital’s recent history included warlords, the Islamic Courts Union, the Ethiopian military, the Shabab and a shaky Western-backed government. This attack on the United Nations Common Compound — 10,000 square meters split between offices and living quarters, just off Mogadishu’s airport road — felt like the city’s fiercest predator had finally decided to take our measure.