LONDON Recently, I found myself in Dallas, a place I'd never been before. As a Muslim writer, I felt about going there pretty much the way an American writer might have felt about heading to the tribal areas of Pakistan: nervous, with the distinct suspicion that the locals carried guns and weren't too fond of folks who look like me.

So I was surprised by the extraordinary hospitality I encountered on my trip. And I still remember the politeness with which one elderly gentleman addressed me in a bookshop. He held a copy of my latest novel, "The Reluctant Fundamentalist," and examined the face on its cover, comparing it to mine. Then he said, nodding once as if to dip the brim of an imaginary hat: "So tell me, sir. Why do they hate us?"

That stopped me cold. I've spent almost half my life in the United States, arriving from Lahore, Pakistan, with my parents in 1974 when I was 3 after my father was accepted to a PhD program at Stanford. I learned to sing "The Star-Spangled Banner" years before I could sing the Pakistani national anthem, played baseball before I could play cricket and wrote in English before I could write in Urdu. My earliest memories are of watching "Star Trek" and "MASH" while my parents barbecued chicken in the back yard. I was an American kid, through and through. Part of me still is.

But when I was 9, I moved back to where I came from. And because where I came from was Pakistan and I was about as all-American as a foreign-born brown boy could be, my perspective a quarter-century later on the question of why "they" hate "us" is perhaps a little more textured than most.

For one thing, part of me identifies with "they" and part with "us." For another, growing up in Pakistan in the 1980s let me see firsthand the devastating effects that the best of U.S. intentions can have.

Talk about why so many Muslims hate the United States these days, and you'll hear plenty of self-flagellation, at least in some quarters of post-9/11 America. I have too much affection for the United States to join in. These people make up the "We deserve to be hated because we're bad" school of thought, which is simplistic and unhelpful. It is simplistic because there are 300 million different components of the "we" that is America. And it is unhelpful because it ignores so much that is good about the nation.

Part of the reason people abroad resent the United States is something Americans can do very little about: envy. The richest, most powerful country in the world attracts the jealousy of others in much the same way that the richest, most powerful man in a small town attracts the jealousy of others. It will come his way no matter how kind, generous or humble he may be.

But there is another major reason for anti-Americanism: the accreted residue of many years of U.S. foreign policies. These policies are unknown to most Americans. They form only minor footnotes in U.S. history. But they are the chapter titles of the histories of other countries, where they have had enormous consequences. America's strength has made it a sort of Gulliver in world affairs: By wiggling its toes it can, often inadvertently, break the arm of a Lilliputian.

When my family moved back to Pakistan, I was given a front-row seat from which to observe one such obscure episode. In 1980, Lahore was a sleepy and rather quiet place. Pakistan's second-largest city was still safe enough for a 9-year-old to hop on his bicycle and ride around unsupervised.

But that was about to change. Soviet troops had recently rolled into Afghanistan, and the U.S. government, concerned about Afghanistan's proximity to the oil-rich Persian Gulf and eager to avenge the humiliating debacle of the Vietnam War, decided to respond. Building on President Jimmy Carter's tough line, President Ronald Reagan offered billions of dollars in economic aid and sophisticated weapons to Pakistan's dictator, Gen. Mohammed Zia ul-Haq. In exchange, Zia supported the mujaheddin, the Afghan guerrillas waging a modern-day holy war against the Soviet occupation. With the help of the CIA, jihadist training camps sprung up in the tribal areas of Pakistan. Soon Kalashnikov assault rifles from those camps began to flood the streets of Lahore, setting in motion a crime wave that put an end to my days of pedaling unsupervised through the streets.

Meanwhile, Zia began an ongoing attempt to Islamize Pakistan and thus make it a more fertile breeding ground for the anti-Soviet jihad. Public female dance performances were banned, female newscasters were told to cover their heads and laws undermining women's rights were passed. Secular politicians, academics and journalists were intimidated, imprisoned and worse.

One part of this was particularly unpleasant for those of us entering our teens: the angry groups of bearded men who began enforcing their own morality codes. They made going on dates risky, even in a fun-loving city such as Lahore. Meanwhile, a surge of cheap heroin -- the currency often used to buy the allegiance of Afghan warlords -- meant that Pakistan went from having virtually no addicts when I was 9 to having more than a million by the time I completed high school, according to a lecture that a U.S. drug-enforcement official gave at my school.