QUINCY — Qais Akbar Omar is a graduate student at Boston University. He grew up in Kabul and spent most of his life in Afghanistan and, after 10 months in Boston, he is still surprised by American ways.

He sees people upset over losing their smartphone or computer files, and he tells them, “This is not the end of the world. The end of the world is when you’re at a ditch filled with dead bodies and you’re thinking, ‘I’m the next one.’ ”

Omar, 30, would know, because he has been that person. He was 10 when he and his grandfather were detained by masked gunmen in Kabul and brought to such a ditch. The gunmen wanted to scare them so his grandfather would give them money. “Otherwise, they would kill us,” Omar said.

On another day Omar and his father were stopped on the street by armed warlords, handcuffed, and forced into an underground prison; they and other prisoners were forced to dig a tunnel so their captors could transport weapons. Men who didn’t measure up were executed. The women were raped. When, after two weeks, they were released, Omar went home to a grieving family and interrupted his own funeral.

As he writes in his powerful new memoir, “A Fort of Nine Towers: An Afghan Family Story,”
Omar has cheated death more than once. During the period of the mujahideen, the so-called ‘‘holy warriors’’ who ended the Soviet occupation in 1989, and into the reign of the Taliban, the country’s factions fought among themselves, and brutality was random and rampant. Kabul got the name Bazzar-e-shaghali, the City of Coyotes.

Between 1992 and 2005, beginning when Omar was 11 and ending when he was 24, his family lived as refugees. For most of that time they lived in a 120-year-old fort in Kabul; when he was 12, they left for what turned out to be a year-long journey across the country — “modern nomads in a beat-up old car” — seeking a way to flee Afghanistan, always staying just a step ahead of the fighting.

His father, he said, “carried us from one place to another to save our lives, like a cat carrying its kittens in its mouth.” Along the way they sought refuge in a cave in the Bamyan Valley, on the cliffs behind the famous sixth-century statues of Buddha. (The statues were blown up by the Taliban in 2001.) They traveled the route known as the Silk Road with a tribe of nomads. They returned to Kabul during a cease-fire, only to have it collapse a few months later; the fighting kept them locked in one room for weeks on end to avoid sniper fire and rockets. When Omar was 18, he was imprisoned for two weeks by extremists for the offense of not wearing a turban.

‘Talking about the past is the best way to cure the pain in your soul.’

“A Fort of Nine Towers” captures a time and a place unknown to most Americans. It’s the history of Afghanistan as seen through the eyes of a boy whose childhood was buffeted by turbulent political currents. Omar was born in 1982 into an educated and prosperous family during the Soviet occupation, when Kabul was relatively calm. When he was 7, his life was interrupted almost overnight when the mujahideen arrived and a grinding civil war followed.

Four and a half years later came the terror of the Taliban, who brought peace “but took the country to the Stone Age with their rules,” Omar said. Men had to grow beards, and woman had to wear burqas. Kite flying and TV-watching were prohibited, the latter punishable by six months in prison. Homosexuals were to be executed. (A method of choice, spelled out in fliers, was: “Take these people to the top of the highest building and hurl them to death.”)

“Nobody wins in Afghanistan,” said Omar, who is in the creative writing program at BU. “If you fight Afghans for eternity, they fight back for eternity. That’s how Afghans are wired.”

“A Fort of Nine Towers” is graphic, certainly, but it’s also sweet and funny and inspiring. The childhood Omar evokes is as idyllic as any: the storytelling, the family dinners with 50 relatives sitting around a cloth in the shadow of pomegranate and apricot trees. The family’s year-long trek across the country may have been hair-raising but Omar also had some of the most exhilarating experiences of his life, such as learning how to weave carpets from a gifted young deaf-mute woman.

As he recalled the journey, Omar sipped tea from an Afghan cup at the kitchen table in his Quincy apartment. He has warm eyes and a stocky build: He learned boxing from his father, who was both a physics teacher and, in his own youth, a well-known boxer. “While thousands of rockets rained over us, boxing was a good way to release tension,” Omar said.

Throughout the apartment are objects that help him stay connected to his past, “to remind myself of the sweet things,” said the engaging Omar, who is single but laughs that he has an aunt in Canada who is doing her best to change that. (He writes in the book, wryly: “I have both arms and legs, which is an issue in mine-ridden Afghanistan.”)

There’s a brass Russian samovar his family used to heat water for tea and for showers, since until three years ago there was no regular electricity. There are many books, both poetry and novels and most of them in English, which he taught himself in six months by listening to the BBC and watching American movies.

The Boston Globe

“Talking about the past is the best way to cure the pain in your soul, said Qais Akbar Omar, author of the memoir “A Fort of Nine Towers.”

When Omar set out to write the book, he didn’t intend to publish it. He already had a career: He’s the fourth generation of his family to work in the carpet trade. For centuries his family were herders — they owned thousands of sheep and camels — until the time of his grandfather who built up a successful carpet business in Kabul. Omar worked as a carpet designer and maker, and during the Taliban era set up a carpet factory in his home with 40 workers. His family still has a shop in Kabul; his father and brother handle the production end, and he handles the selling end. Omar likes to say he knows the business “from sheep to shop.” With his sincere, engaging manner you can see why he’s a good salesman.

“I make friends everywhere I go,” he said, earnestly. “I have to be friendly with everyone so I can sell them some carpets!”

He wrote the book partly to try to hold on to people he had lost. Partly, he wanted Westerners to know about the Afghanistan that isn’t in the news: a land of natural beauty, inhabited by proud, honorable, resilient, and decent people like his relatives, whom he misses deeply. He inherited a love of reading from his grandfather, he said, whose shelves held volumes of poetry, literature, even the works of Sigmund Freud.

And partly, he wrote to “chase away the demons who haunt my dreams,” he said. “Talking about the past is the best way to cure the pain in your soul.”

He would never have written it if Stephen Landrigan hadn’t come to Afghanistan, Omar said. When they met in 2005, Landrigan was a Boston journalist, writer, and aid worker for an education program funded by the United States Agency for International Development. He was also working on a book about carpet-making in Afghanistan and recruited Omar to be his interpreter.

Impressed by Omar’s intelligence and resourcefulness, Landrigan invited him to be his co-author on the carpet book and to work with him on yet another of his projects: a Dari-language production of Shakespeare’s “Love’s Labour’s Lost” which was being directed in 2005 by French actress Corinne Jaber. (Landrigan adapted the script; Omar was translator and the assistant director. Together they wrote a 2012 book about the production called “Shakespeare in Kabul.”)

Slowly, Landrigan picked up bits and pieces about Omar’s past. “We’d be someplace and it would trigger a memory. Or he’d come in looking a little haggard and say he’d had bad dreams,” said Landrigan, who lives in West Roxbury and is a consultant for the US Department of Commerce. He suggested that Omar write down the things that troubled him, so maybe they wouldn’t trouble him as much.

That was in late 2006. Landrigan went home to Boston for Christmas and returned to Kabul eight weeks later. Omar came to see him with a 400-page manuscript in his hands. “He said, ‘Well, I did it,’ ” Landrigan said. “Apparently he just sat down and wrote the book. Which is how Qais [rhymes with “ice”] does things.”

Omar could hardly stop himself from writing it. “It came out like a whoosh, a flood,” he said. “I was writing and writing and writing. I barely went out of the house.” He chose to write it in English instead of Dari because he found it less painful. “I think in English but feel in Dari,” said Omar. “You transfer your pain from one language to another, and in the transfer, the pain decreases.”

Landrigan immediately recognized that the book was exceptional, not just because of the power of the storytelling but because it illuminated the mujahideen period, which few Westerners know much about.

“Americans knew about the Taliban, but the whole mujahideen period, which went on for four or five years, did more to shape the current situation in Afghanistan than anything since,” Landrigan said. “America was not paying attention to Afghanistan in those days. Horrible things happened, and Qais talked about them.”

Landrigan helped Omar find an agent, by “going down the list on the Internet and writing letters and mostly never hearing back.” Eventually, in 2011, they landed on Jessica Papin, a New York agent with Dystel and Goderich who had been working on books about the Middle East since 2005, and who lived in Cairo for 2½ years to work with the American University in Cairo Press.

“I thought [Qais’s] query letter was extraordinary,” said Papin, who stayed up all night reading the manuscript. “He’s a gifted storyteller but has a straightforward lyricism. I was incredulous,” she said. “It’s for precisely this reason I became a literary agent.”

Meanwhile, with the global economy at a crawl, Omar’s carpet business was slow. As his book neared completion, he grew nervous about being in Afghanistan. “I talked about people in [my book] who made such a mess in Afghanistan. They are still in power. Telling the truth in Afghanistan means someone may kill you the next day. I could not risk it.”

In August 2012, he left for the United States. He spent a semester at Brandeis University in a graduate school business program, but felt it more finance-oriented than he wanted and not entrepreneurial enough. In January he switched to the creative writing program at BU, where he was granted a full scholarship. “We weren’t about to see him forced to go home and get beheaded if we could help it,” said Leslie Epstein, director of the program, who was dazzled by Omar’s writing. “This was a humanitarian emergency.”

In order to stay, he will need a student visa; if he leaves, he’s been told it would not be easy to return. Meanwhile, he is working on a trilogy of novels telling the story of several generations of an Afghan family. He’s touring the country to promote “A Fort of Nine Towers,” which was published in April by Farrar, Straus and Giroux. The book has had strong reviews in The New York Times, The Washington Post, and internationally, and he’s been interviewed by radio and TV stations around the world.

He already has some US customers for his carpet business, Kabul Carpets & Kilims, but he’s looking for more, spending as much time as possible visiting showrooms and carpet fairs and giving talks on Afghan rugs.

“I always stay very, very busy,” said Omar. “To be away from my past I focus on a lot of different things. If I have nothing to do, I take long walks or run or climb to keep my mind busy with something else. I also get a good workout out of it,” he smiled. “But I’ve paid a huge price for it.”