For two months before heading off to Afghanistan in 2010, where I served as a cultural advisor to two brigade commanders, I experienced recurring nightmares that always ended in death — my death.

In some dreams, I was taken out by a sniper perched atop a nearby building. As if cross-cut for a movie, this dream offered dual perspectives. I could both watch myself from the sniper’s point of view and feel the force of his precision shot.

As a cultural advisor, I knew that I would be regularly heading “outside the wire” to interview Afghans in small villages in an effort to document the availability of education, the need for medical care, tribal conflicts both new and long-standing, local attitudes towards the Afghan National Police and the Afghan National Army, and the threats that locals felt from insurgents.

I was no stranger to war. In December 2008 and January 2009, I traveled to Iraq as a journalist. While there, I quickly became accustomed to the evening alarms that signaled “incoming,” fire at the base from the beds of insurgent “gun and go” pickups. These were never sustained attacks. After firing, the pickups quickly retreated for cover into a nearby village. More often than not, the insurgents launched their attacks when most of us were at dinner. On one of the larger bases, which featured four different salad bars, a taco bar, a baked potato bar, two main lines and two “healthy lines,” at the sound of the alarm, we would drag our trays and chairs against the safest wall and finish our meal, wait for the all-clear signal, then return our chairs and help ourselves to dessert.

But this deployment to Afghanistan would be different. I would be gone longer, and regularly venturing “outside the wire” (off the base) into hostile territory. I needed to prepare for everything that could go wrong.

Before I left, I completed Army courses on over twenty topics: how to recognize an improvised explosive device, how to detect both industrial espionage and terrorism, how to treat head wounds, and how to prevent sexual harassment and suicide (both mine and others). I took classes on Afghan history, language and geography, and on how to survive if taken prisoner. I learned that with a tube of crazy glue I could suture a wound and that I could treat mosquito bites and minor burns with toothpaste.

As the departure day drew closer, I increased my life insurance, pre-paid my household bills, submitted to one inoculation after another and packed my supply of antimalarials.

Despite my preparations, the death dreams persisted. I never told my husband or family about these troubling dreams. I didn’t want to ignite fears in them that I had no way of soothing. Instead, I invoked a form of magical thinking. If the people I cared about bought my effort to downplay the risk, then my characterization of it might actually be true. And, to a certain extent, I did convince myself. Yet despite my reassurances, the nightmares continued to give ghostly substance to my fears of an extended deployment.

On my last weekend home, I did something I had not done before heading off to Iraq: I wrote farewell letters to my loved ones “to be opened in the event of my death,” letters I hoped would never be read.

For centuries, soldiers have written letters intended to be read after their deaths. Sometimes they are called goodbye letters. Or death letters. They typically begin, “If you are reading this…” and often express confidence in the cause and the sacrifice it necessitates, confirm courage, express contrition for past slights, and issue injunctions against excessive mourning.

Take, for example, what Major Andy Olmsted (a.k.a. blogger G’Kar) wrote in a post he’d arranged to be uploaded in the possible event of his death:

“What I don’t want this to be is a chance for me, or anyone else, to be maudlin. I’m dead. That sucks, at least for me and my family and friends. But all the tears in the world aren’t going to bring me back, so I would prefer that people remember the good things about me rather than mourning my loss. (If it turns out a specific number of tears will, in fact, bring me back to life, then by all means, break out the onions.)”

Olmsted was killed in Iraq on Jan. 3, 2008, when he tried to persuade two armed insurgents to put down their weapons rather than be killed. While trying to make the case for surrender through an interpreter, one of the cornered insurgents shot and killed him. The next day his post was uploaded by fellow blogger “Hilzoy.”

Like the “death letters” written by soldiers from other wars, mine thanked those I loved most in the world for enriching my life and concluded with the fanciful hope that I could somehow extend my love beyond the grave.

I told one daughter: “From the day you were born, I’ve delighted in seeing the world afresh through your eyes, through all the curiosity and creativity you shined upon it. Because of you this world has been a much richer place in which to dwell all these years.”

I wrote to the other: “Your gift of empathy revealed itself even before you started school, and watching you interact with others in kind and thoughtful ways has taught me a good deal. I guess that we all want to believe in a consciousness after death. If there is a way of looking back at those left behind, please know that I’ll be smiling as I see you put your gifts to good ends helping others.”

* * *

Writing these letters produced a cluster of confusing emotions. On the one hand, it required me, imaginatively at least, to mourn my own death, a burden from which the actual dead are blissfully free. On the other, it forced me to anticipate the loss that those I care most about might suffer, pain from which the dead are similarly exempt.

Death letters give form to an all-important connection between the living and the dead. On July 14, 1861, just days before the First Battle of Bull Run, Major Sullivan Ballou wrote to his wife Sarah:

“If the dead can come back to this earth and flit unseen around those they love, I shall always be with you in the brightest day and the darkest night…always…always. And when the soft breeze fans your cheek, it shall be my breath, or the cool air your throbbing temple, it shall be my spirit passing by.”

Major Ballou died in that battle.

For me, writing these letters was like an out-of-body experience. I did the best I could at adopting the posthumous persona and composing the words that I wanted to ring in the minds of those I love: words of thanks, words meant to inspire confidence, words collected for one final, comforting embrace.

I asked my daughters to care for each other, and my husband to look forward rather than back and to seek the comfort of friends. I implored them all, in various ways, to set down the burden of loss when the time felt right and to walk forward into a full life into which I would occasionally intrude as a fond memory.

When I was a year old and my sister seven, a mining accident took our father’s life, so we were raised by our mother, who is no longer living. To my sister I wrote:

“If Mom was the still point of my turning world, you, my only sister and dear friend, were the force that encouraged me to explore the world beyond our little mountain village. You were the one who taught me to drive, who took me to visit colleges, and whose example I tried to live up to. I know how close you’ve been to Kate and Elizabeth [my daughters], and I trust that you’ll be there to take my place at the the weddings and the births of children I’ll miss. On those occasions, be sure to hug them twice – once for you and once for me.”

During today’s deployments, nobody ever speaks of these letters, as if mentioning them might destroy their magic. And some leave these letters on the laptops they take “downrange” to their corner of the war zone, knowing that the words will be found in due time by a parent or spouse. Still others don’t write them at all, considering the act a sign of bad luck.

Some make videos of their goodbyes to be discovered among their effects returned in a special shipment following the transport of their bodies. They know that a couple of buddies will pack up all their possessions for return, toss out any porn or tobacco (the latter for those who have either taken up or resumed chewing or smoking during deployment) and carefully preserve anything intended for loved ones.

After writing my own letters, I sealed them and put them in a fireproof document box.

* * *

I headed from Fort Benning, Georgia, to the tent city of Ali Al Salem in Kuwait, the Army’s Twilight Zone. For over a decade, the Army base at Ali Al Salem has served as the transfer station for Army personnel on their way to the conflicts in Iraq and Afghanistan. One only goes to this dusty tent city to change planes, but catching the next flight can take anywhere from two days to three weeks.

When Army engineers built this base in the middle of nothing in all directions, they discovered the sand was too fine to make into cement. They had to import sand to construct the cement platforms for the generators and buildings on base. I was lucky; after only three days in Sand City, I boarded a large troop transport flight to Bagram Airfield in Afghanistan where, after three days, I caught a small mail flight to another large base. After six hours of trying to catch some sleep on the cement floor of the hanger there, I hopped onto a convoy headed to the headquarters of the unit I was joining.

My work in Afghanistan often took me off base to document the extent of a lingering drought and the food insecurity that accompanied it, the epidemic of dysentery in rural villages, the rate of unemployment, the corruption rampant in the fledgling legal system America and its allies had tried to foster, and the taxes levied by insurgents on area farmers at harvest time. Together with a small team of three others, we collected a list of the real leaders (the arbabs and mullahs) in area villagers, because in the past, Western military leaders had engaged with individuals they took to be important elders in Iraq and Afghanistan only to learn that they were not.

We traveled to small villages, to the few remaining schools in the heavily Taliban-influenced district, and to the large local bazaar with its long line of dirt-floored stalls where over a hundred merchants sold farm supplies, veterinary medicines, motorcycles, materials for making I.E.D.’s (improvised explosive devices), drugs intended for the local clinic that had been mysteriously diverted to this makeshift drugstore, boots, plastic pails, decorated metal trunks, CDs that featured what some soldiers referred to as “the latest Taliban Fight songs,” naan, potatoes, raisins, produce in season, and freshly slaughtered lamb.

Rather than improving, security in this area became worse each month. When I had first traveled to the base, we could go twelve kilometers before encountering a tic, short for “troops in contact.” Within nine months, the circle of safety had shrunk to one kilometer.

A soldier in whose vehicle I often rode received a package from his young son, and amid the toiletries, candy and cookies was a five-inch plastic toy. At first, he simply propped the toy on his dashboard to remind him of his son, but after the first firefight from which he safely returned, the figure accrued talismanic meaning, and the soldier turned away the toy that he believed was his protection so that it no longer faced him, but instead looked out the windshield. It was as if, like a charm, it had the power to ward off the enemy’s evil eye.

Many personnel brought small tokens given to them by parents, children, lovers and fellow soldiers. Some were objects of faith —medals, rosaries, prayer beads, angels, crosses, gold and silver lockets with verses of the Quran tucked inside. Others acquired their significance from one’s relation to the giver. Still others accrued meaning along the way. What might be considered minor trinkets back home takes on a new meaning when one ventures into harm’s way.

I packed my own magic. My sister gave me the gold cross that my grandmother gave my father when he headed off to fight in France in WWII, and I wore that with one of my dog tags and a Saint George medal a friend sent with me. Saint George the dragon slayer, revered by both Christians and Muslims, enjoys a special place in military lore. On August 23, 1914, the British Expeditionary Force found itself outnumbered by the Germans outside the Belgian city of Mons, but miraculously managed to retreat to safety. Days after the battle, journalist and fantasy writer Arthur Machen published in the The Evening News a fictional account of the battle that most readers in England and abroad took to be true.

According to Machen, a British soldier at the front, fearing that the Germans would slaughter them all, called on St. George. Answering this plea, St. George arrived in the thick of battle smoke with a fresh heavenly regiment of Agincourt bowmen, warriors who had achieved a major English victory in the Hundred Years’ War five centuries earlier. Machen’s story was simply too good not to be true, and it made its way into many a sermon, appeared in the pages of religious pamphlets and even surfaced in a few eyewitness accounts of veterans who survived the conflict.

The friend who had given me this religious medal was Catholic; I am not, but I discovered in interviews for an article on combat charms that you don’t have to be a believer for the magic to work. Chip, a young officer training Afghan police, is a case in point. His commander had given him a set of Muslim prayer beads after one too many close calls. The commander’s was a “you need these more than I do” gift, one that Chip has kept in his pocket on every deployment, though neither Chip nor his commander is Muslim.

Like tokens of faith, farewell letters join a host of other rituals practiced by military personnel to summon courage in the face of death.

Soldiers carry into deployment fresh tattoos, some with slogans like “Death Before Dishonor.” Other tattoos will memorialize a buddy lost in a previous deployment. Still others feature elaborate skulls. And in our recent wars, members of the combat arms have tattooed their “meat tags,” or dog tags, onto their torsos. Since the single most deadly weapon in the insurgent’s arsenal is the improvised explosive device, many soldiers make sure that their body, should it be blown up, can be distinguished from the remains of others.

But every squad leader and his platoon leader know who is going out on every mission and would instantly know who is missing. What’s more, bodies would likely be charred and the “meat tag” unrecognizable were the explosion to leave only a torso. The ritual of going with buddies to get such a tattoo allows soldiers to acknowledge the worst that might happen, note that harsh fact on their flesh, and then get on with the mission.

Meat tags function in the same way as death letters; they symbolically inoculate the soldier against incapacitating thoughts.

Unlike tattoos, death letters are less universal than they were in previous wars. In World War II these farewell letters sometimes appeared in newspapers. Today, phone and Internet connections, active twenty-four hours a day on large bases, have allowed soldiers and Marines to check in daily and to Skype with their lovers, spouses and children.

But these frequent communications, often focused on the routine and the mundane of everyday life at home, rarely hold the profundity of a letter containing words the author intends as his or her last.

One night, when I was at headquarters, home to over 2,000 Army personnel, I decided to call home and headed out over the river rock that covered every road and walkway on base, past the rows of b-huts (one-story plywood housing reserved for officers and contractors), past the bank, past the dining facility to the MWR, which stands for “morale, welfare and recreation.” Inside, makeshift cubicles, each with either a phone or computer, lined the walls of this small shack, and although we could all hear each other’s conversations, we pretended that we couldn’t. Most spoke in a dull monotone, reporting little of the tedium at headquarters but eager to hear about happenings at home.

On this chilly February night, one young soldier was speaking with animation, excited to have his girlfriend or wife on the end of the line and to tell her about the gift he’d ordered for her. He said, “It’s great, honey. You’ll love it. It turns fuzzy just like my wiener.” At that point everyone in the room, who had until then pretended to be absorbed in his or her own communication, broke out in applause.

Death letters, on the other hand, offer final words cherished by their recipients. In her book “The Letter: My Journey Through Love, Loss, and Life,” Marie Tillman opens with a discussion of the letter left prior to his deployment by her husband, Army Ranger and NFL player Pat Tillman, which she read on the day she learned of his death.

In his letter, Pat Tillman made one request of his wife:

“Through the years I’ve asked a great deal of you, therefore it should surprise you little that I have another favor to ask: I ask that you live.”

At a time when all she wanted to do was to give up, his “just in case” letter was the one she reread the most because it offered her the guidance she needed to go on.

“Nothing about the day seemed real except for this letter that I could touch and feel. It was both precious and awful — the last communication I’d ever have with Pat. I sat holding it for many minutes. Then I carefully opened the seal. My breath caught, and I paused another moment with my eyes closed.”

* * *

In those days before my deployment, I felt relieved after writing my death letters. I had completed an act that, in all its ritual exactness, left me with a strange sense of protection. The prophylactic move had made it much easier to enter that bizarre land of war.

To my astonishment and relief, after writing them, I never again dreamed of my own death.

Towards the end of my time in Afghanistan, I left the base that housed three officers and sixty soldiers for the last time and returned to my halfway base, the battalion headquarters on the outskirts of a small Afghan city, home to about twenty officers and two hundred enlisted personnel. The next day, a motorcyclist tossed a couple of grenades into a boy’s school just as the boys had gathered at the gates for dismissal.

The Army insulates, or tries to insulate itself, from the insanity of war by enacting a rigid and logical system of decision-making leading to action. A highly scripted process, it is designed to remove all emotion. But on that night, all efforts at comprehension seemed puny in the face of such a senseless act.

For many who deploy, war is a territory located somewhere between the country of the living and the land of the dead, a realm in which time and space operate according to different rules. Some soldiers quote Lt. Speirs in “Band of Brothers” insisting that deployment is a form of death.

If the liminal state of deployment is like death, then “redeployment” (counterintuitive military speak for coming home) is like rebirth, the return to a multi-colored world, one in which the trees are so green they hurt your eyes, the lights so bright you want to turn them all off, and a twenty-minute shower so soothing it feels like sin.

And with return comes the sweet knowledge that those death letters do not have to be read, for now.

* * *

Carol Burke is the author of “Camp All-American, Hanoi Jane, and the High-and-Tight.” She is currently writing a memoir about her experiences in Iraq and Afghanistan. She is a professor at the University of California, Irvine, and teaches in the Literary Journalism Program.

Julia Gfrörer was born in 1982 in Concord, New Hampshire. Her work has appeared in Thickness, Arthur Magazine, Study Group Magazine, Black Eye and Best American Comics, and her graphic novel, “Black Is the Color,” was published by Fantagraphics Books. Her last name rhymes with despair, and her heart is black as jet.