For three years, a Journal reporter in Baghdad tried to work and live normally -- as the war closed in.

Two days before leaving Baghdad, I canceled my last interviews, abandoned the carefully planned trips around town to say good-bye to Iraqi friends and ditched the farewell party with fellow journalists.

It wasn't how I imagined my departure from Iraq would be, after three years of living and working there as a correspondent for The Wall Street Journal. But the British security firm we hired had warned in an email that insurgents were plotting to kidnap a female American journalist and advised women not to leave their hotel unless absolutely necessary.

Several weeks later, my friend Jill Carroll, a correspondent for the Christian Science Monitor, was abducted in broad daylight at gunpoint as she left an interview in Baghdad. Her Iraqi translator was murdered. As I write this, despite pleas for her release the world over, Jill remains in captivity.

I began going to Iraq in October of 2002, when it was still ruled by Saddam Hussein. I covered the war from the Kurdish northern area, moving to Baghdad after the regime fell. For about a year after the U.S.-led invasion -- from the spring of 2003 to 2004 -- reporting in Iraq was challenging, but didn't always seem life-threatening. I shared the job of running our Baghdad bureau with my colleague Yochi Dreazen. We had a small staff of dedicated Iraqi employees who assisted us in gathering news. We could go almost anywhere in Iraq on a moment's notice and discover fascinating stories. We traveled in a regular car, unprotected. I wore Western clothes -- pants and T-shirts, skirts, sandals -- and walked freely around Baghdad, chatting with shopkeepers and having lunch or dinner with people I met.

I tried to make a home in Iraq, a task that seemed feasible at first, but grew more and more difficult. In the quest for a safe place, I moved eight times. Each location was more heavily fortified than the last. For a time, I lived with other journalists in a villa with black marble floors and wood-paneled walls and a garden dotted with orange and date trees, in the upscale neighborhood of Mansur. We left that house in 2004, after, within the space of a few weeks, a car bomb exploded outside our house and several foreigners were abducted and beheaded in the neighborhood.

The Hamra Hotel, where we maintained an office, is now barricaded behind blast walls, cement road blocks, checkpoints manned by armed guards and iron gates installed at the entrance. But even that didn't deter an attack on the hotel last November, when a truck packed with 1,000 tons of explosive detonated at the gate. Fortunately, it was too early for anyone to be in our office. It was demolished.

My Iraq assignment, at first a source of pride, eventually became my family's worst nightmare. They battled enormous anxiety, struggling to support my decision to stay in Baghdad. My grandmother, who lives in Iran, couldn't comprehend that I had volunteered for the post and kept insisting I immediately resign. I tried to protect them by being vague and downplaying the danger. I called and emailed after every massive explosion. My younger sister and only sibling, Tannaz, got engaged last summer. She had one request: "Your only gift to me is if you stop going back to Iraq. I just want you alive and at my wedding."

I was incredibly fortunate to be in Iraq with my boyfriend, Babak Dehghanpisheh, a correspondent for Newsweek magazine, whom I met while covering the war in Afghanistan. Being in Baghdad together was remarkable, but it also multiplied the fear and anxiety. Once, early on, we were stuck behind a bombed-out bridge in Tikrit when an angry mob swarmed our car, slamming sticks and rifles on the windows, shouting "Infidels, we will kill you."

"Sahafi, Sahafi," we shouted, using the Arabic word for "journalist." The Marines, who were on the other side of the river, noticed the commotion and came to our rescue. They dispersed the crowd and gave us refuge inside Saddam Hussein's Palace, where they had just arrived.

Another time, we were chased and fired on by a gang of men on the highway north of Baghdad. Babak threw our flak jackets on our bodies and pinned me to the floor of the car, promising he wouldn't let them take me. Our driver saved our lives by outrunning the gunmen.

As the madness around us grew, the desire to create something resembling a domestic life intensified. We became experts in turning the dingiest rooms into somewhat cheerful spaces. I lit vanilla candles to get rid of the rotten smell and threw an orange and red tribal Kilim on the torn-up carpet of one room. Babak put Kevlar blankets on the window and taped up the glass to protect us from shrapnel and bullets. I had a coffee-maker and decent coffee. He had DVDs of the latest Hollywood movies and a selection of music.

If the hotel or house happened to have a kitchen, I cooked dinner, preferably the most non-Iraqi recipe I could think of, like pad thai, tacos, coconut curries or banana pancakes for Valentine's Day. I cherished mundane tasks like grocery shopping, lingering in the aisles of the Honey Market, a Christian-owned supermarket that imported exotic goods such as bacon and lemongrass. There were candle-lit dinners interrupted by gunfire outside and movie nights cut short when electricity went out.

We formed intense friendships with other journalists, monitoring each other for security. If we had people over for dinner, we had to count not just the number of plates, but also the number of beds and linens we could provide; it had become too dangerous for guests to go home after dark. Among reporters, a favorite escape was surfing the Internet, planning vacations, preferably as far from the Middle East as possible. We exchanged tips on diving and hiking expeditions, airline deals and restaurants in the Caribbean and Africa.

The worst stress for Babak and me was when one of us was safe and the other in harm's way. In September 2004, I was on the phone with Babak, who was out of Iraq, when a car bomb exploded outside the house in Mansur that we shared with other foreigners. The force of the explosion threw me to the floor, but it didn't disconnect the line. He heard the boom, then my scream, the glass shattering and the chaotic shouts of the staff in Arabic. Pieces of flesh and metal rained into our garden. For hours, we stayed trapped inside the house as we pondered what to do next. If we left, the insurgents could be around the corner and abduct us. If we stayed, they could storm the house or mortar it. Babak called at least once every half hour. The next day, we evacuated.

In November 2004, Babak embedded with the third battalion, first Marine division entering Fallujah, one of the first units to take on the insurgents. I was dispatched to Ramallah, West Bank, to cover Yasser Arafat's impending death. On the day Arafat died, Babak called. He told me the unit had suffered casualties. Midway through the conversation, I heard machine gunfire and the Marines shouting at him. "Gotta go, gotta go," he said abruptly, and the line went dead.

It took 36 hours for him to call back. I remember barely being able to function, wandering around among mobs of Palestinians who had poured onto the streets to grieve for Arafat. I spotted a satellite truck parked in the square and a news photographer, whom I didn't know, filing his pictures. I asked him if he had access to the newswires and could check for an update on Fallujah. I must have been crying because he only asked "Who's there?" He didn't even wait for a reply, just handed me his laptop.

Being a woman correspondent in an Arab Muslim culture proved to be a huge asset. Men -- even politicians -- are often less guarded, and women allow you inside their homes and into their lives. When security deteriorated, it was much easier for women reporters to travel incognito under local garb and head scarves. My Iranian-American identity became particularly useful. I was born in Idaho to Iranian parents, who were Muslim but secular. As a small child, I was raised in Tehran, then moved back to the U.S. in 1979, after the Islamic revolution in Iran.

I wore and shed my heritage and upbringing depending on the situation. With American soldiers, I stressed growing up in Oregon and going to school in New York. With Iraqis, being Iranian was a source of bonding; the bitter war between the two nations is mostly blamed on the governments and the people often feel more kinship than animosity. Even our staff in Iraq told me I wasn't "entirely American." In their eyes, I wasn't from a distant, privileged nation but from a country next door that, like Iraq, had known -- to a much-lesser degree -- war, upheaval, sanctions and suffering.

The current climate of fear in Iraq was a gradual transformation. It began in April of 2004 with the murder and mutilation of four security contractors in Fallujah and the uprising of Shiite militia in Sadr City. The insurgency was spreading and gaining strength faster than we had imagined possible. For the first time, I hired armed guards and began traveling in a fully armored car. Outings were measured and limited and road trips were few and far between.

By the fall of 2004, insurgents were abducting foreigners from their homes in Baghdad. I began relying heavily on our staff for setting up interviews, conducting street reporting and being my eyes and ears in Baghdad. Occasionally, they managed to persuade Iraqis to come to our hotel for interviews, giving me a chance to interact personally with sources and subjects.

As security deteriorated around the country, the areas in which we could safely operate shrank. We could no longer jump in the car and travel to various provinces and find out how things were faring. For stories outside Baghdad, we had to travel with the U.S. military or the State Department. Embedding with the American military or government wasn't the perfect solution, but it still offered a glimpse, albeit limited, into what was happening in areas where we couldn't travel independently. We also relied on Iraqi reporters we hired to provide information about places we could not go.

Their help allowed us to get stories on how regular Iraqi citizens were coping. For a story about how the rise of sectarian violence was changing relationships among neighbors in the mixed Shiite-Sunni neighborhood of Doura, our Iraqi team set out to local mosques, barber shops, grocery stores and cafs, talking to dozens of people. When we determined we had a story, the Iraq staff chose several people and drove them to our hotel, where I spent hours interviewing each of them.

I marvel at the commitment and courage of our Iraqi staffers, in helping tell the story of their country, despite grave risks to them and their families. I have withheld their last names for their protection. We went to great lengths to make sure they weren't associated with us; if they were seen working with Americans it would endanger them.

By the end of last year, we had strict security measures in place and reviewed them each time we left the house, whether to conduct an interview or to buy milk. As a rule of thumb, we never stayed anywhere for more than half an hour because any longer would allow time for a kidnapping to be orchestrated.

Drivers made sure our armored car and "chase" car -- which follows the first car as a surveillance vehicle -- were running smoothly. A guard loaded his AK-47 rifle and secured a handgun to his waist. Haqi, our translator and office manager, tested the walkie-talkie radios and placed the first-aid kit in the back seat. I draped myself in a head-to-toe black abbaya covering, the traditional attire of conservative Arab women, and sat in the back.

The goal was to be invisible, to not be noticed as a foreigner when stuck in traffic, behind a red light or whizzing through Baghdad streets. You just never knew who was sitting in the car next to you. Would they pull out a gun? Would they spot the car and chase you down the road? Would they drag you out? Who would sell you out? Would they have mercy on your Iraqi staff?

In addition to the Iraqis I met and interviewed for stories, the war was unfolding intimately before me, through day-to-day contact with the staff. They would come to work sleep-deprived because, in summer heat of 120 degrees, they had no electricity to turn on air conditioning nor could they sleep outside because of stray bullets and random gunfire. One staffer invested two years of savings from work for us into a shop -- and then robbers stormed in one afternoon and swept it clean of cash and goods.

The random nature of the violence was devastating. In Baghdad, kidnappings of Iraqis for money became common, with dozens of people abducted daily. One of our drivers was kidnapped one afternoon when he went to pick up a relative from the hospital. The kidnappers hung him upside down and went through every name in his cellphone and asked who they were. Like many Iraqis, he didn't keep foreign names in his phone, as a safety precaution. He was released after his family paid a cash ransom. A Shiite doctor, the 32-year-old cousin of one of our translators, was murdered outside his house, in a wave of sectarian attacks on doctors.

"We live like animals in the wild," Munaf, another driver, would often say. "We eat, we sleep and we try not to get killed each day."

I left Iraq on Dec. 18. On the morning of my departure, the Iraqi staff arrived early to review security procedures and prepare for the airport journey. I made them tea and we sat in the garden munching cookies stuffed with fresh dates, baked for me by my driver's mother.

The six miles ride to the airport, which is located inside an American military base, is on one of the most dangerous roads in the country due to landmines, shooting sprees and car bombs aimed at military convoys. Missiles frequently hit the airport, landing near the runway; I counted two that day. Planes corkscrew sharply, like a rocket, as they land and take off to avoid being downed by enemy fire. At the airport, the staff and I had a tearful good-bye. I wished I was leaving them in better circumstances. Our relationship had grown from working together to find stories to trusting each other with our lives.

"This isn't good-bye," I told them. Haqi, my gregarious assistant and office manager, hugged me and said, "They can take you out of Iraq but they won't be able to take Iraq out of you."

I have now settled into my new home in Beirut, Lebanon, where as the Journal's senior Middle East correspondent, I will be covering Iran and the Arab world. A new correspondent will succeed me in Baghdad.

Beirut, a once dangerous, war-torn city is now relatively safe, cosmopolitan and booming. Two decades ago, foreign correspondents fled Lebanon in fear for their lives; now they are flocking back, setting up homes and regional bureaus as the city reclaims its reputation as the "Paris of the Middle East." I can only hope for a similar future for Iraq.