Kabul, Afghanistan (CNN) -- Saiz Ahmed, an American Ph.D. student in Kabul studying Afghan legal history, had just eaten dinner and returned to his fourth-floor room at the Hotel Inter-Continental when he heard odd noises. His room was pitch black because the electricity was out, and he did not initially recognize the sounds.
"I thought it was construction," he said, recalling that a sign he had seen earlier in the day on the elevator apologizing to guests for work being done.
But the noises got louder, and he soon realized that it was not construction. "It was clear that people were shooting from inside the building -- a number of people I didn't know where -- and from outside," he said. "I didn't know who was who."
Over the three or four hours, the gunfire was punctuated by an explosion every 45 minutes or so, he said. "They might have been people blowing themselves up," he said, adding he heard six or seven such blasts.
As the blasts continued, he got calls on his cell phone from his relatives in Kabul, from his relatives in the United States and from the U.S. Embassy. All of them offered the same advice: stay put.
Heeding that advice, he stayed inside the room on the floor, near a corner that he thought might be safest. But the explosions got closer.
"I've never experienced explosions that near," he said. "The ground shook."
The last explosion occurred frighteningly close. "I felt the ground move up," he said. "I was just praying that the next one wouldn't be right under me or above me or anywhere else where there were people."
Ahmed said he felt like death was imminent. "I'm sure none of us thought we were going to make it," he said. "I wrote my little will -- just in case."
He then placed the document in his pocket. It stipulates, according to Islamic law, the charities to which he wanted to donate.
Finally, after some six hours, he could hear English being spoken in the hallway yelling "fire" and urging guests locked in their rooms to come out. He followed their orders and entered the hallway, where the air was thick with dust. He and other guests there were ordered to put their hands up and identify themselves. They were escorted to the basement, where security officials checked them to ensure they were not Taliban and where relief cascaded upon them.
"As soon as we were able to get to the basement, people started praying, thanking God," he said.
After about an hour, they were released. The carcasses of cars that had been blown up littered the parking lot. Glass from the hotel windows lay in shards.
But, though they had been told the danger was over, shooting erupted nearby. Ahmed and a group of fellow guests ran down the hill on which the hotel was built.
Ahmed said he never saw the attackers and is glad he didn't. "I think I might not be here if that as the case," he said. Still, he had spent much of the night imagining what he would do if he had come into contact with them. "I could convince them that what they were doing was stupid," he said. "To target civilians like that."
But Ahmed said the experience has left him anxious to express himself to others, too, including to U.S. President Barack Obama, who announced last week that all of the 33,000 additional U.S. forces he ordered to Afghanistan in December 2009 will be home within 15 months.
"I'm very mad about this war -- on all sides," Ahmed said. "I'd say this war needs to end now. This war that his predecessor started could have been avoided. Forgive me for going off, but this is what I was thinking in my room when I didn't know if I would see my wife again, would see my family again. And I was thinking: This is the life of Afghans for the past 10 years."
The United States did not need to initiate a war nearly a decade ago to kill Osama bin Laden, whose al Qaeda group carried out the 9/11 terrorist attacks, Ahmed said.
"I want everybody involved who has forces here on Afghan soil to think about that," he said. "There has got to be a peaceful solution to this. It's just crazy."
CNN's Brian Walker contributed to this story