In 2008, Canadian journalist Mellissa Fung survived 28 days in captivity after being kidnapped by bandits while on assignment in Afghanistan. As difficult as that ordeal was, Fung says writing about it was almost as painful.

"It was really hard to write. It was one of the hardest things I've had to do," Fung said Friday of her new book, "Under an Afghan Sky."

Fung told CTV's Canada AM that while many asked her to describe her experience in captivity in Afghanistan, she never really wanted to write a book about it.

"When I first came back from Afghanistan, I just wanted to forget about the whole experience and tuck it away somewhere in the recesses of my mind and really move on," she said.

Fung struggled with telling her own story, since journalists are not supposed to become the story and she still felt horrible that she had. But the more difficult part was being forced to relive the memories.

"It was having to go back there so vividly to make the reader understand exactly what I was going through. I had to put myself back there so they could see what I saw and smelled what I smelled. And it was really difficult," she said.

Fung was taken prisoner in October, 2008, while reporting for CBC. She had just finished wrapping up interviews with Afghan refugees outside Kabul when a car drove up with three men inside armed with AK assault rifles who tried to force her into the car.

Fung fought back and was stabbed in the shoulder when she punched one of the men in the face. Her translator and driver were beaten and left behind by the kidnappers.

Fung was driven to an abandoned house with bullet-ridden walls and a dirty floor.

"And I thought, ‘Well at least there's a window. It's not going to be too terrible. And then they told me, ‘No, this is not where you're staying'," she remembered.

Her captors led her around back of the house and showed her a large hole in the ground.

"And they said, ‘That's where you're going to be.' The hole was probably the size of a manhole. And I said, ‘No way. I'm not going in there.' But they threw me in. They picked me up and threw me in."

For the next 28 days Fung was fed only biscuits, juice boxes and cigarettes. She had a bucket to use as a toilet, and a makeshift light that ran on batteries.

Each of the men stood guard over her for about three weeks and on the second night of her captivity, one of the men sexually assaulted her – an ordeal that Fung refused to describe in earlier drafts of the book.

"I really immediately had to block it out of my memory. Otherwise, I don't know how I would have survived the next four weeks," she says.

Fung says she still doesn't know how she stayed sane and kept up hope for 28 days.

"I prayed a lot. I had a small pocket rosary. I got to know some of my kidnappers. I interviewed them, I tried to get inside their heads to know what their motivations were for doing this," she says.

Fung quickly realized her kidnapping was not an organized effort and that her captors were not Taliban insurgents, but instead a ragtag group of thugs hoping for a ransom.

One of the men seemed more sympathetic than the others. He told Fung from the start that he had no plans to kill her – something she says she made him repeat to her again and again over the next month.

"I had to hold him to that because for me, that was the only hope I had that I would make it out alive," she says.

"I really do believe that he had some sympathy for me. He kept apologizing and saying, ‘I'm sorry I took you. I'm sorry you're not feeling well. Please don't cry.' He would hold my hand. So I really believe that despite what he did to me – kidnapping me – there was a good person in there."

Fung still had her notebook with her and wrote extensively during her captivity. In the end, when she was finally released, her captors didn't let her take her notebook. But she says writing letters to her friends and family and bosses at work brought her some comfort.

Throughout her captivity, Canadians were not told that one of their journalists was being held prisoner. The capture was kept secret by international media so as not to compromise the negotiations for her release without mounting public pressure.

Now that she's free, Fung has decided to use her new book to help the Afghan women and children she left behind. Her portion of the royalties from the book sales will go to the Ayenda Foundation in Afghanistan, which is teaching women and children Internet computer skills.