"Any jokes or inappropriate remarks may result in your arrest," says a robotic voice over the Tannoy at Bush Intercontinental Airport in Houston, as I join the silent procession of bleary-eyed passengers disembarking from the plane after a ten-hour transatlantic flight. Welcome, as they say, to the United States.

I'm in Texas on holiday, making the annual pilgrimage to see my in-laws. I married an American in 2003, and each time we return to her homeland I'm reminded of the New Yorker journalist Hendrik Hertzberg's description of the "brutal fuck-you that greets foreigners arriving in the United States", and his call to US immigration officials to stop making "preventive war" on innocent tourists. "It might make us more friends."

But making friends isn't high on the agenda at Bush Intercontinental. This is my ninth trip to Houston since 2000, and it doesn't get any easier. I attributed a rare smooth entry in March last year to the change in administration, from bellicose Bush to benign Barack. My mistake.

“What is the purpose of your trip?" asks a morose airport official, thumbing through my passport and refusing to look me in the eye. The badge on his arm says "US Customs and Border Patrol", part of the department of homeland security. Perhaps I don't look happy enough to be here on holiday. Moments later, I'm deposited in a homeland security "holding lounge". "Why am I here?" I ask the nearest uniformed officer. "Random check," he grunts. Random? I'm sitting in a room filled exclusively with black, Hispanic and Asian passengers.

Name and shame

Nor is it my first time in this "lounge". A few years ago I spent several hours here, detained because my surname matched that of a wanted insurgent inside Iraq. Yes, "Hasan" - the Middle Eastern equivalent of "Smith" or "Jones". Incidentally, I note an addition to the waiting room in the form of a giant map of Afghanistan and Pakistan. Iraq is so 2003.

Why does my detention matter? Isn't my inconvenience far less important than US airport security? Of course, but as the former secretary of state Colin Powell remarked in 2007: "We are taking too much counsel of our fears . . . Let's make sure people come to Disney World and not throw them up against the wall in Orlando simply because they have a Muslim name . . . Let's show the world a face of openness and what a democratic system can do."

Time and again we have been told that the "war on terror" is at its core a struggle for hearts and minds. Not so on US borders, where foreigners are met, in Hertzberg's words, with "delays, ugliness, sullen contempt and near chaos while being treated alternately as cattle or potential terrorists". Despite Hollywood's best efforts, millions of people across the world no longer consider the US to be "the land of the free and the home of the brave" (to quote the national anthem), the "shining city upon a hill" (Ronald Reagan), or the "indispensable nation" (Madeleine Albright).

Indeed, anti-Americanism is rife. Some argue it has a long and shameful history, pre-dating even the founding of the United States in 1776. In the mid-18th century, the French naturalist the Comte de Buffon - together with Voltaire and the Dutch philosopher Cornelius de Pauw, among others - condemned the "degeneracy" of the inhabitants of the Americas. But as the British historian Tony Judt points out, anti-Americanism today is not confined to smug intellectuals - European or otherwise. Most foreigners are untroubled by the cultural dominance of the US, and many even aspire to the so-called American way of life. "Most of them don't despise America, and they certainly don't hate Americans," Judt writes. "What upsets them is US foreign policy . . ."

There is evidence to support this. During the eight years of the Bush administration, with its lawless and bloody wars, positive opinion of the US declined in most European countries. A Pew Global Attitudes Project poll showed how, between 2000 and 2006, "favourable opinions" of the US dropped from 83 per cent to 56 per cent in the UK, from 62 per cent to 39 per cent in France and from 78 per cent to 37 per cent in Germany. In the Middle East, Zogby Inter­national found that negative attitudes towards the US jumped between 2002 and 2004, from 76 per cent to 98 per cent in Egypt, from 61 per cent to 88 per cent in Morocco and from 87 per cent to 94 per cent in Saudi Arabia - and these are allies of Uncle Sam. Respondents in most of these countries said they objected, above all, to US foreign policies that they considered unjust.

Love, actually

In Destiny Disrupted: a History of the World Through Islamic Eyes, the Afghan-American writer Tamim Ansary shows how the Middle Eastern view of the US in the early 20th century was much more positive than negative. Wilsonian idealism was seductive to Arabs living under colonial rule but craving self-determination. It was, Ansary argues, only after the CIA-funded coup against the secular, democratically elected prime minister of Iran, Muhammed Mossadeq, that anger and disillusionment with the US spread across the region.

Noam Chomsky, bête noire of the right, has long argued that the notion of anti-Americanism itself seeks to excuse the crimes of US elites and "identify state policy with the society, the people, the culture". It is an important point. I condemn the actions of the US government in Iraq, Afghanistan and Yemen, without attacking my American friends in Houston, LA or New York.

“I am willing to love all mankind," Samuel Johnson said, "except an American." I cannot agree. I may be considered anti-American, in that I abhor many US foreign policies, but the person I love most happens to be an American. America is not the American government. Nor is it the US border patrol.