One moment I was standing in a quiet, secure and heavily guarded area and the next it had turned into a battlefield.
It was 6.30am, and I waiting with about 20 other journalists for an escort into the palace for a speech by President Hamid Karzai. It was a routine assignment for Kabul journalists, and the presidential compound is a scenic and peaceful oasis lined with pine trees in my chaotic hometown.
Suddenly I saw the four armed men jump out of their vehicle. They kneeled down and started shooting. Two of them fired at presidential palace security guards stationed at a checkpoint. The two others aimed their weapons at the Ariana Hotel, where the CIA is known to have an office.
I didn't know what to do. Bullets were flying all over. Gunfire was coming from different directions. No one really knew who were the attackers and who were the security forces because both sides were wearing similar uniforms.
I thought at first that this must be an insider attack or an argument between security guards. I just couldn't believe that Taliban fighters could have made it this far into the presidential compound, through two checkpoints. Soon I realized they must be Taliban.
I hit the ground and kept my head down, asking myself, what I should do? I looked around to try to find a place to use as a shelter and call my office - report the news as fast as possible.
Mostly, though, my thoughts focused on my small children - my nearly 6-year-old son, Mohammad Akmal, and my two daughters, Hadia, who is 4, and Muqadasa, just 15 months.
Some other reporters took shelter behind an armored SUV used by an American television network. A few others lay in a ditch.
I saw a white, small, religious shrine nearby, and crawled about 10 to 15 metres, then ran as fast as I could toward the wall of the shrine. I saw blood on my clothes but was sure I had not been hit. Later I noticed scratches on my arms and knees from pulling my body across the ground.
I finally reached the wall and thought it was safe enough to take my mobile phone and call the office.
Breathless and scared, I shouted over the phone to a colleague, "David, attackers are inside and shooting is going on." He was shocked.
Grenades and rockets were exploding in the background and automatic weapons were firing. My colleague asked, "Are you safe, Rahim? Are you OK? I replied I was fine, even if I wasn't entirely.
Then I managed to take a deep breath and started reporting, the battle still going on in the background.
Most of the reporters moved with me behind the shrine.
Looking out, we saw a small boy, around 6 years old, wearing a school uniform and running close to us. He was so brave, not crying, but of course very worried.
We grabbed him and pulled him behind the wall. He didn't know how to call his parents but one of the reporters had a number for the director of his nearby school. He called and told the director that one of his students was with us and safe.
I wanted to move out from behind the wall and take some photos with my cell phone. But bullets kept coming and never gave me the chance. We all wanted to leave from our precarious position, but security guards from the other gate, about 50 meters (yards) away from us, kept shouting that we must stay there. Otherwise we could be shot from the CIA building because guards there wouldn't know who we were.
We sheltered behind that wall for about an hour until the shooting finally eased. During that time, my father called me twice. I lied to him, telling him I was farther from the battle than I really was.
More guards moved into the area, first securing it and finally motioning to us one by one to leave. By then, we later learned, eight attackers and three guards lay dead.
But at the moment I wasn't sure whether other attackers were hiding nearby. I felt safe only when I finally got away from the area. I called my father and told him I was on my way back to the office and not to worry.
EDITOR'S NOTE: Rahim Faiez, a correspondent with The Associated Press in Afghanistan since January 2002, was waiting in a security area outside the heavily fortified Afghan presidential compound in Kabul for an escort to the palace to cover a speech by President Hamid Karzai when he got caught up Tuesday in a Taliban attack. This is his account.