I never thought I'd write a personal story about being a war correspondent. It seemed so beside the point, so much less important than the story I was reporting. Some of my closest friends are photographers and writers who've worked in war zones, and whenever we'd get questions like "What's it like to be a woman and work in Afghanistan or Iraq?" we'd roll our eyes. It was an attitude, for sure, but one we were proud of.

When I was asked to write about being pregnant and embedded with soldiers in Afghanistan, I said OK. But I was still reluctant. And so the months passed. Then, not long ago, I got an email from a colonel in the army's media affairs office, saying they were declining my next embed request in part because "you failed to disclose your pregnancy". What troubled me more than the refusal was that the colonel was a woman. Compare the email I got from another colonel, a man: "Congratulations! I heard you are due in February – forever you will provide Rock Paratroopers with stories. 5(+) months pregnant humping up the Abas Ghar!" (the 8,400ft mountain ridge in the Korengal valley).

How could a woman, particularly in the military, not understand why I would have kept my pregnancy to myself? Is it true that the toughest adversary for women is still other women? I may be extracting too much out of a simple anecdote, but it was enough to make me want to tell the story. One reason was visceral: I wanted to get even with her. The other is more complicated.

On a muggy August afternoon, I dragged myself and my flu to an infectious-disease doctor. I asked him if he could give me some antibiotics for Afghanistan that were safe to take when you're pregnant. His eyes leapt up from his notes.

"How far along are you?"

"Three months and a bit."

I stared at a James Nachtwey photograph on his wall as he regaled me with stories about his war-photographer patients, all of whom were men. Clearly, I posed a different equation.

"Are you sure you will be able to run?" he said. "Because you're going to need to run, and I have to advise you not to go in your condition." Suddenly he was rigging up a heart-monitoring machine on my chest and pointing out my supposedly irregular heartbeat arrowing up and down the page. "I just came for a prescription," I said. "If I wanted someone to tell me not to go to Afghanistan, I could have called my mother."

Outside, the heat was stultifying, but I felt light, my flu miraculously subdued to a tickle in the throat. I thought about a journalist I'd known in Iraq whose wife wanted him home for the birth of their fifth child, but who stayed anyway for the invasion. And the French photographer with two kids who was shot in three different war zones, the last time nearly paralysing his arm. I couldn't think of one who'd stopped because of a pregnancy or his family. Especially if there wasn't a penny in the bank and a baby was on the way. I walked out, went home, and booked my ticket.

A few days later I was 7,500ft above sea level, short of breath, tears streaming down my face, tumbling headfirst down a jagged mountain slope in the dark, body armour, backpack, baby and all. I could hear Lynsey – my partner in crime, an extraordinary photographer – gasp and then burst out laughing.

We'd ended up in the Korengal valley, a place of everglade beauty, screeching monkeys, and gruff mountain tribes. "It's really not fit for women," the media affairs guy had said. "There's nowhere for you to sleep." "Then we'll go," we'd said. That's where we wanted to be: the place not fit for women. By which I guess he meant male, smelly, rough. We were doing a story on air strikes and civilian casualties, and I wanted the point of view of the soldiers dropping the bombs.

And that's what happened on our first night at Camp Blessing, the battalion headquarters in the Pech River valley in eastern Afghanistan. We were inside the TOC – the tactical operations centre, which is like a big, classified PlayStation. The landscape comes to life on a movie screen by way of Google Earth and Predator drone video feeds. The Americans zeroed in on a few bad guys firing mortars from a roof. One soldier joked that we were about to get our first glimpse of Kill TV. The screen flashed, bright static, as a 500lb bomb hit the roof. The mortar stopped. So did the men. It was a snuff film. They call it pred porn.

Early the next morning we were in a Chinook, hugging the contours of the rocky peaks and then sprinting across the landing zone to avoid getting shot at. I found big, brash 27-year-old Captain Dan Kearney, dubbed the Lord of the Korengal Valley, in the well-equipped medic's tent. On the bed sat a boy with blood-stained eyes, his face covered in gashes. He wouldn't or couldn't talk. The villagers said he was wounded by the American bomb that also killed two women. Two more women were wounded and outside the gate, but the villagers wouldn't let them be treated because the medic was a man. The women could die, said the medic. The men still refused. "Welcome to my life," said Dan. Taliban attack his soldiers from the villages. He retaliates. Afghan women and children die.

"Pull out his eyes, apologise; apologise, pull out his eyes". The old, taunting rhyme bounced in my head as I looked into the eyes of an Afghan woman lying limp and frightened on a hospital bed down the valley in Kunar's capital. Attached to her was a nursing child. The bomb had landed on her house, killing her husband. Her eyes moved behind me, seemed to tour the room; then, seeing no salvation, they lost focus. There were other wounded women in the beds. One had lost her husband a year ago in a feud, and now her teenage son had been killed in the bombing. She was asking the doctor, me, anyone who'd listen, "Who will take care of me?" The doctor translated for them and then pursued me down the hall, urging me to tell the Americans to please stop bombing their villages. "It's too much, it's too much," he said. He was young, with a creased, tired face and was craning his head to catch up with me. "Please tell them," he said. "They might listen to you. They won't listen to us."

I said that I would and I meant it, and I knew it would make no difference. It was as a 12-year-old girl had asked me five years earlier in Kandahar, squirming in her hospital bed. She'd been playing in the courtyard at her sister's wedding when gunships burst out of the night, killing her entire family. "Why do you bomb us and then come saying you're sorry?"

Nightmare. Will we never stop? I imagined trying to shelter my own child from air strikes and being unable to. And suddenly I was overwhelmed at the thought of becoming a mother. I saw myself pinned to the bed. Baby at the breast. Life over. Helpless. I was supposed to be overjoyed. Many women I know at the edge of fertility are going through IVF and surrogate mothers, sleeping with friends and strangers, inseminating themselves with their gay friends' sperm, scrolling through sperm banks to find the perfect baby daddy – to be a mother. In my moments of paralysing ambivalence, I found myself assaulted at newsagents on every corner by our pregnant and baby-laden stars hanging like icons around an altar. Ambivalence, on the other hand, was not for sale. Does any pantheon even have a goddess of doubt?

A few months earlier, all I'd wanted in the world was a child. The father would be a special part of our lives, but I'd be a mum on my own. That didn't deter me. But now in the hospital, where I was supposed to be taking meticulous notes, I froze. I've been a nomad most of my life, uninterested in and unhindered by the domestic. "Babies need homes, Ellie" – the warnings of a South African soldier friend echoed in my head.

Lynsey appeared with her cameras. And a message. Nisar, my friend from Kunar who was waiting outside (men cannot enter the women's ward), said it was getting dangerous to stay in the hospital any longer. We ducked into the burqas that would hide us on the streets. It was a relief to shuffle anonymously inside the musty blue nylon cage, and I decided to defy caution, go back to the soldiers dropping bombs in the mountains, and deliver the doctor's message.

I settled into life with the soldiers, sharing their bunkers, barns, cots, and spine-breaking 4am hikes. I scavenged their care packages for chicken-noodle soup and shampoo. One night, Lynsey and I were deep inside the back of a Humvee with two young, insecure intelligence officers at the helm as we set off for an all-night mission to capture Taliban. A truckload of Afghan special forces in our convoy had just driven over a cliff.

"If the shit hits the fan," said the one driving, "can you load those bullets into the machine gun?" I fingered the toothpaste-tube-sized cartridges in their bandoliers piled up next to me. "Sure," I said as Lynsey and I gave each other a what-are-we-doing-here look. Then, shouting louder over the engine, he said, "Don't you think it's a little irresponsible to be pregnant in a war zone?"

I couldn't imagine how he knew. I looked over at Lynsey, who was shrugging and mouthing: "I didn't say anything."

"Don't you think as an intelligence officer you should get your intel right?" I cringed, even as I said it.

Five hours later, our convoy was trapped in the enemy village. The roads were donkey paths, not fit for 2.5-ton Humvees. The roosters were up. Charcoal clouds appeared in the pre-dawn light. The Humvee was stifling and I had consumed seven bottles of water and I was four months pregnant and my bladder was going to explode and I couldn't get out or I might get killed.

"Do you guys have a knife?" One of them handed me a Leatherman. I sliced the top of a water bottle off, climbed up on to the seat, then crouched and peed. No one noticed. I filled up six bottles, tossed each out the window. The last time I missed the bottle.

Over the next weeks I found myself peeing on the floors of bombed-out homes, abandoned cottages, and goat pens. My blood-filled womb attracted every flea in the Korengal Valley. The medics gave me flea collars and toxic anti-flea lotion, along with ibuprofen (which I'd stash away, because you can't take it when you're pregnant) and compression bandages for my swollen ankles. Nothing worked.

When I had boarded the helicopter to come back to the Korengal, I armed myself with the heroic tales of pregnant women I'd known. There was my friend Ayub's mother, who was harvesting tobacco when she delivered the last of her eight children in Halabja. And the Bosnian woman who was nine months pregnant when the militias attacked her town. As she fled through the mountains, mortars exploding around her, she went into labour. A villager scooped her up in a wheelbarrow, and there she gave birth to her son. Maybe stories are nourishment. Because as bad as it got – like at the end of an 18-hour patrol, when I ended up on the medics' trolley suffering from dehydration, and felt my body sucking hungrily on the juices of two IV drips – I compared my situation with the wheelbarrow or the Afghan women, and I couldn't really complain.

Summer gave way to a cold mountain autumn. The company was gearing up for a six-day mission in enemy terrain. I was nearing six months. Was I crazy? Maybe. But I also knew this was it: a 21st-century dilemma stripped of all theory, playing out in life, death, absurdity, and coinciding with the last weeks I could possibly stay out there.

Death in the Korengal had many arrangements. A girl died of shrapnel wounds, maybe American shrapnel, maybe insurgents'. Her father gave her bracelets to a soldier who'd tried to save her. A sergeant died of a sniper's bullet because he was giving visitors a tour. A US Marine training Afghan soldiers died in an ambush defending Afghan soldiers. Soldiers had to kill their dogs. (The higher-ups figured they had diseases.) Death was a daily dialogue. One night I watched a flea bouncing on my distended belly. I drifted off and dreamt that the baby was in a rubbery goat-skinned wine sack, suffocating and shrinking. The night before I'd dreamt she was a dwarfed donkey. Some nights, after a day of jets ripping the land apart with 2,000lb bombs, and insurgents crashing mortars into the base, I'd put earphones on my stomach, hoping the vibrations of Horowitz playing Mozart's B-flat sonatas would soothe her. And every night she soothed me against despair and mortality.

We had a few days until the full moon and the mission. Sergeant Nestell, an Apache-American who'd suffered Lynsey and me in his bunker, asked me, "Do you have your gear?" I looked around sheepishly. "Monkeys ate my gear?" I'm sure I was grating on his nerves. And while Lynsey and I provided comic relief on patrols for Dan, the captain, to the rest of the pack, particularly a vigilant survivor like Nestell, we were a loud liability. Nevertheless, he emerged from behind his curtain with long johns, thermal socks, even his wooby (the soldiers' camouflage blanket, and one of their most prized possessions).

3am. Enemy territory. I'm on a mountain ridge with Dan and his command cell. Below, dozens of soldiers are spilling out of choppers around the villages. The insurgents are on their radios, getting ready to strike. Dan is not going to let them, and soon the night sky lights up with air strikes, gunships, rockets and bombs. Around dawn, Dan's lieutenant radios. He's with the village elder. There are five dead and 11 wounded women and children. Dan is depressed. He wants to go down and explain. He wants the villagers to know there were bad guys there. At one point he says, "I'll take any advice you got, Liz." Later I say, "Didn't you know this would happen?"

"Yeah, I did." But did he have a choice? In his mind the choice was – my soldiers or the Afghans.

3am. TWO NIGHTS LATER. We're hiking above the tree line in the dark, and I can't figure out how to work my night-vision goggles, and I'm freezing and everything's throbbing in pain, and I can see no reason to be searching abandoned Afghan summer cottages. I have an epiphany. Up ahead, I can make out a boulder. As soon as I reach it, I'll just slip behind, lie down, and go to sleep. I have another epiphany: if I stop moving I'll freeze. Then suddenly the line's stopped. There's a soldier worse off than me. "Get the fuck up, Spino," shouts an officer. "Get the fuck up, fucking Spino." I love you, Spino. I lie down on my pack, and now the throbbing makes me cry, and if I don't pee, I'm going to explode. I start counting the stars.

We slept in our flak jackets in a ditch that night, Lynsey, me, a couple of soldiers, spooning to stay warm. The next day, as the sun sank again, I remembered Nestell's advice: heat up rocks, put them in a ditch, and lie over them with a blanket. True, a fire could give you away. But we'd been on the insurgents' home turf for days. They already knew everything. We heard them on the radio talking about us. How could a little fire harm anyone? Many of the soldiers out there took a turn in the oven. It was bliss.

The next day, Lynsey and I and a few soldiers hiked down to the woods where 2nd Platoon was watching the valley. It was a beautiful afternoon. Then we were ambushed. My heart surged into my throat. The doctor was right: I can't run. But I have to or I'll die. So I ran. I ran after Piosa, the young lieutenant, up to the ridge, past two bloodied, wounded soldiers— Rice and Vandenberge. As soon as I saw Clinard, a towering, blue-eyed soldier, crying "Rougle's dying and it's my fault," I wanted to disintegrate. Rougle was lying behind him, already dead. The insurgents had climbed up the mountain, shot Rougle, Rice and Vandenberge, and stolen their equipment. Rougle. Battle Company's best. He and his scouts were badder than the rest, travelling in their own pack, sleeping in the wild. Next leave, Rougle was heading to ask his girlfriend's dad for permission to marry her.

Four Afghan soldiers began dragging his body through the dried leaves and branches, and Raeon, a fellow scout, lost it on them, me, the world. He shoved the Afghans aside and lofted Rougle up over his shoulder, fireman-style, drenching his back in Rougle's insides. I turned away. My tape recorder stopped working, and I was forced to take notes. The job is the only thing that saves you.

Two days later, I flew back to the base. Around midnight, guys from 1st Platoon filed in, drenched in river water and blood. Mohammad Tali, the ugliest Taliban on the bad-guy family tree, had nearly dragged off Brennan, whom I'd watched playing guitar all day long before the mission. Brennan would die that night. So did Hugo Mendoza, 1st Platoon's smiling medic. Shelton, their platoon sergeant, was caked in Tali's brains and blood. I listened to Dan, hunched over, call the boys' parents, one by one, and recount what happened and how their sons had died.

I went to the showers, peeled off the clothes I hadn't taken off in six days, and disappeared under the patter of warm water. I cried for the hundredth time. I thought of the doctor. I never did deliver his message. I could see that as long as the soldiers were there, the Korengalis would keep shooting from the villages and the Americans would keep bombing them. The only thing I could do was write about it.

Border crossings require resolve. Getting on a plane, getting married, moving, taking a job, writing the first words. Babies cry themselves to sleep resisting the transition from wakefulness to slumber. Throughout my life I've kept a classification of the two kinds of people in the world: those who dwell in the land of ambivalence and those who give it a glance and drive on. Those who know where they're going, and the perpetual rubberneckers. I had no idea what I was getting into when I flew up to the Korengal Outpost, met Kearney, and realised I'd have to stick it out for two months to tell the story I was after. But it's no surprise to me that I ended up in extremis, completely distracted through the middle of pregnancy.

finally I left the soldiers and the mountains, though not before telling Dan what he already knew – that I was six months pregnant. It wasn't until I was back in civilian life in Kabul that I began to worry. I'd contracted some Afghan illness. "Time for you to go home," wrote my brother. "You are not built like Afghan women. We are from shtetl, not mountain people." But I was stubborn. My friend Najib, a doctor and journalist, took my blood pressure with a kit he'd ordered from the internet, and it read 70 over 40. "I'd be dead, Najib." "Well, you look horrible, and it's really low." What was worse, I couldn't feel the baby's flutters any more. He called a friend with a sonogram machine.

It was raining, cold, dark, and electricity was out in much of the city. We entered an old building cratered by Cold War rockets. Najib pushed me past the patients waiting in the blacked-out hallway. I was rushed into a room and greeted by a tall, smiling Afghan doctor who'd studied in Indiana. By the time I was on my back, shirt up, a guy began banging on the door and shouting: why the hell did the foreigner cut the line? I was sure he was going to crash through the door, exposing me to the crowd. I wondered how they could be so patient with us – we'd caused bombings, kidnappings, massive rent inflation, and we threw our weight around in big SUVs, cutting corners, queues, and laws, just like the warlords.

I turned my head to the sonogram screen, and there was what I'd come for: a small black-and-white static, pulsing. It was her heart. Then I saw her hand in her mouth, and that was it.

In retrospect, I can see that the act of keeping a secret allowed me to forestall being pregnant, becoming a mother, changing my life. But whatever abstraction "having a baby" was up until that moment, it was over. I was besotted. Whenever she stopped hiccuping or kicking inside, I missed her. The next question was simply how I'd ever get on a plane again and go to Afghanistan without her.