But this is not just President Ahmadinejad. The antipathy goes back to colonial times, and the long and tortured history of British intervention in Iran.

This anti-British sentiment is shared by ordinary Iranians. Its resonance defies boundaries of age, education, social class or political affiliation. In the eyes of a broad cross-section of the population, Britain - as much, or even more than, the US - is the real enemy. Four decades after the sun set on its imperial might, the Machiavellian instincts of the "old coloniser" are believed to be alive, well and still acting against the interests of Iran. For every mishap - whether a bombing, rising living costs or simply the advent of an unpopular government - a hidden British hand is often thought to be at work.

I first became aware of this conviction 18 months ago on a visit to Ahvaz, capital of the south-western province of Khuzestan. A bomb attack - the latest in a series - had killed six people in the city's main street. The incident seemed to be linked to Arab separatists in the mainly Arabic-speaking province, but the Iranian authorities blamed Britain, pointing to the British military presence across the border in southern Iraq. Eulogists at public mourning ceremonies organised by the revolutionary guards railed against "criminal England".

When I visited Ali Narimousayi, whose 20-year-old daughter, Ghazaleh, had been blown up in the blast, it became clear that the message carried a wider currency. "We know they want to come here and take our oil for free and we won't let them," he said. "Why is Britain so against our nuclear programme? Have we ever mistreated their ambassador or their people? What have we ever done to them? Go back to Britain and tell [the politicians] to be in good relations with Iran."

This was not just grief talking. When I expressed amazement to my Iranian mother-in-law at the belief in the existence of an omnipotent Britain, she smiled knowingly and said: "You are the masters and we are the servants."

The view was evident in Tehran this week, despite low public awareness of the sailors' plight (partly because of the current no rouz ((new year)) holiday). Shahim Nouri, 24, working in an optician's across from the British Council in Shariati Street, summed up the views of many affluent anti-regime Iranians. "I'm not old enough to know the history but everybody says Britain is behind the clerical regime. If it is not behind the mullahs, it is definitely in a relationship with them," he said.

Iranians' belief in the power of the British is "psychological and cultural", according to Issa Sakharhiz, a political analyst. "Much of it stems from historical matters and the British role in third-world countries, especially Iran, over the past 100 years," he says. "It's been reinforced by the closeness of Britain's relationship with the US in the past two decades, particularly its involvement in the military occupations of Iraq and Afghanistan. There are also lingering feelings over the western-backed war Saddam Hussein waged against Iran in the 1980s - the British were heavily involved in that. In the past 20 years, these suspicions have been exaggerated because everybody knows the US is in the frontline working against the benefits of the third world countries and that Britain doesn't have its previous power. But that psychological and cultural relationship that Iranians have towards Britain and the belief that it is behind everything is very important. It will take decades of quiet (Anglo-Iranian) relations to change it."

Quiet has seldom been an apt description of the British relationship with Iran in modern times. It started during the 19th century as Iran - along with Afghanistan - became a pawn in the imperial Great Game between Britain and Tsarist Russia. The British sought successfully to use Iran as a buffer to bolster its position in India against the tsarist empire.

In doing so, however, they created an enmity supplanting the traditional Iranian fear and loathing of Russia. Fuelling it was a quickly acquired habit of meddling in Iranian politics and a pattern of monopolising the country's vital natural resources.

Relations quickly soured after a succession of monarchs - wanting to finance lavish courts - granted economic concessions to British entrepreneurs. In 1872, Nasser Al-din Shah granted Baron Paul Julius de Reuter - the founder of the Reuters news agency - exclusive rights over extensive parts of the economy, including railways, roads, tramways, irrigation works and all minerals except gold and silver. In 1896, the shah granted the forerunner of British Imperial Tobacco rights over the production, sale and export of Iranian tobacco. The move triggered mass protests led by Iran's Shia clergy and was supported by merchants in the bazaars. Police fired on one demonstration in Tehran, killing several unarmed protesters. Amid the outcry, the concession was cancelled, leaving Iran with its first foreign debt - £500,000 borrowed to compensate the British tobacco company - and a deep reservoir of anti-British feeling.

But the most important concession concerned a substance whose importance was lost on Iran's rulers - oil. In 1901, William Knox D'Arcy, a London-based lawyer and businessman, was granted exploration rights in most of Iran's oil fields for the princely sum of £20,000. It took several years for D'Arcy's investment to bear fruit but when it did - after he struck oil in Masjid-e Suleiman in 1908 - its effect was enduring and fateful.

It turned out to be the world's largest oil field to date and a year later, D'Arcy's concession was merged into the Anglo-Persian Oil Company (APOC). In 1913, with war clouds gathering in Europe, the British admiralty - under Winston Churchill - discarded coal in favour of oil to power its battleships. To safeguard the decision, the government bought a 51% stake in APOC. The importance of oil - and Iran - in British imperial expansion was now explicit. It was a priority of which Churchill, for one, would never lose sight.

For the next four decades, the oil company and Britain remained close to the heart of Iranian political and economic life and became twin sources of burning national resentment.

In 1921, the British - seeking a strongman ruler to replace the teetering Qajar dynasty - threw its weight behind a charismatic colonel, Reza Khan, commander of the powerful Cossack brigades. Within four years, Khan had seized power, anointed himself Reza Shah and instituted the Pahlavi monarchy. With British acquiescence, he ushered in a reign of repressive modernisation which, among other things, outlawed women's Islamic hijab and repressed the clergy. He thus gave the religious establishment reason to suspect and detest Britain.

He did not, however, do Britain's bidding. During the 1930s, Reza Shah developed an admiration for Hitler and turned towards Germany, who had offered to build modern railways - an idea the British feared as a potential invasion route of India. As a result, Britain invaded Iran in 1941 and occupied the southern half of its territory. At the same time, it deposed Reza Shah and replaced him with his 21-year-old son, Mohammad Reza Pahlavi. Despite his accession to the Peacock Throne, the young monarch never forgave his benefactors for their treatment of his father. Neither did the monarchists loyal to Reza Shah. Britain had alienated yet another sector of Iranian society.

Meanwhile, anger over the arrogant behaviour of the now-renamed Anglo-Iranian Oil Company - it later became BP - was leading inevitably to a fateful confrontation between Britain and Iran. Resentment over Iran's paltry share of company profits had festered for years. In 1947, out of an annual profit of £40m, Iran received just £7m. Iranian anger was further fuelled by the treatment of oil-company workers who were restricted to low-paid menial jobs and kept in squalid living conditions, in contrast to the luxury in which their British masters lived. Attempts at persuading the oil company to give Iran a bigger share of the profits and its workers a fairer deal proved fruitless. The result was a standoff that created conditions ripe for a nationalist revolt.

Into this ferment walked Mohammad Mossadegh, a lawyer and leftwing secular nationalist politician fated to go down as perhaps Iranian history's biggest martyr before British perfidy. Mossadegh was elected prime minister in 1951 advocating a straightforward solution to the oil question - nationalisation. It was a goal he carried out with single-minded zeal while lambasting the British imperialists in tones redolent of a later Iranian leader, Mahmoud Ahmadinejad. Within months, he had ordered the Iranian state to take over the oil company and expelled its British management and workers.

The company and the British government reacted furiously. The Labour government of Clement Attlee imposed a naval blockade in the Gulf and asked the UN security council to condemn Iran. Instead, the council embarrassingly came out in Iran's favour. Meanwhile, Mossadegh - who often did business in his pyjamas - embarked on an American tour in the naive belief that the US would back him against the British "colonisers".

It was a serious misjudgment. The oil company's executives were clamouring for a coup to overthrow Mossadegh. Attlee rebuffed the idea but when a Conservative government took office in October 1951, led by Churchill, it fell on more sympathetic ears.

With British power in decline, however, Churchill was unable to mount such a venture alone. American help would be needed. The result was Operation Ajax, a CIA-MI6 putsch that co-opted a loose coalition of monarchists, nationalist generals, conservative mullahs and street thugs to overthrow Mossadegh. With the economy teetering in the face of the British blockade, Mossadegh was ousted after several days of violent street clashes.

The shah, at that time a weak figure, had fled to Rome fearing the coup would fail. When he heard the news of Mossadegh's demise, he responded: "I knew they loved me." He subsequently returned to install a brutally repressive regime - maintained in power by the notorious Savak secret police -backed to the hilt by both America and Britain for the next 25 years.

The British remained loyal to the shah throughout the violent upheavals that presaged his own overthrow in January 1979. The Labour foreign secretary of the time, David Owen, gave the monarch vocal support even as millions took to the streets in Tehran to demand an end to the dictatorship. Britain's stance provoked a brief takeover of its Tehran embassy by opposition protesters in November 1978. The shah, however, was unconvinced. In the final days of his reign, beleaguered and bewildered at the forces ranged against him, he told the US ambassador, William Sullivan, that he "detected the hand of the English" behind the demonstrations. Sullivan couldn't believe his ears but it is a view still held by royalists a generation later.

After the revolution, the Islamic authorities continued to draw on national resentment at more than a century of British interference, damning Britain as the "little Satan" (the US was the "Great Satan"). Such feelings were further fed by London's support for Saddam Hussein during the 1980-88 Iran-Iraq war, despite Baghdad having started the war and subsequently resorting to chemical weapons. London and Tehran were at loggerheads again in 1989 after the revolution's spiritual leader, Ayatollah Ruhollah Khomeini, issued a fatwa (religious edict) sentencing the British author, Salman Rushdie, to death for blasphemy over his novel, The Satanic Verses.

The antipathy resurfaced most recently in June 2004 in an incident with uncanny parallels to the current stand-off. Then, eight British sailors were seized and paraded blindfold on state TV after allegedly straying into Iranian waters in the Shatt al-Arab waterway, where the 15 currently in detention were intercepted and arrested last Friday. On the previous occasion, the Britons were released following an apology from the foreign secretary at the time, Jack Straw.

The Anglo-American invasions of both Iraq and Afghanistan have once again brought British troops to Iran's borders. Although Iran opposed the invasion of Iraq, it gave the occupation forces few problems in the early years, as it built up its influence in the Shia areas controlled by Britain in the south. That has all changed in the past year or so, as Iranian-backed militias have increasingly challenged the British occupation forces, both politically and militarily.

The British RAF personnel and marines in Iran's captivity may well be oblivious to the long-accumulated resentments that have provided the backdrop to their detentions. Perhaps they are learning something of this tortured history from their captors.