Migrants fleeing persecution and poverty settled with their children in the East End of London. As believers in one God they were devoted to their holy book, which contained strict religious laws, harsh penalties and gender inequality. Some of them established separate religious courts. The men wore dark clothes and had long beards; some women covered their hair. A royal commission warned of the grave dangers of self-segregation. Politicians said different religious dress was a sign of separation. Some migrants were members of extremist political groups. Others actively organised to overthrow the established western political order. Campaigners against the migrants carefully framed their arguments as objections to "alien extremists" and not to a race or religion. A British cabinet minister said we were facing a clash about civilisation: this was about values; a battle between progress and "arrested development".

All this happened a hundred years ago to Jewish migrants seeking asylum in Britain. The political movements with which they were closely associated were anarchism and later Bolshevism. As in the case of contemporary political violence, or even the radical Islamism supported by a minority of British Muslims, anarchism and Bolshevism only commanded minority support among the Jewish community. But shared countries of origin and a common ethnic and religious background were enough to create a racialised discourse whenever there were anarchist outrages in London in the early 20th century.

Most anarchists were peaceful, but a few resorted to violent attacks such as the bombing of Greenwich Observatory in 1894 - described at the time as an "international terrorist outrage". Anarchist violence was an international phenomenon. In Europe it claimed hundreds of lives, including those of several heads of government, and resulted in anti- terrorism laws. In the siege of Sidney Street in London in 1911, police and troops confronted east European Jewish anarchists. This violent confrontation in the heart of London created a racialised moral panic in which the whole Jewish community was stigmatised. It was claimed that London was "seething" with violent aliens, and the British establishment was said to be "in a state of denial". East End Jews were said to be "alienated", not "integrated", and a "threat to our security" a long time before anyone dreamed up the phrase "Londonistan".

Today the Middle East is the focus of a challenge to American political and economic hegemony, which is being presented as a "civilisational conflict with Islam". Nearly a century ago, the Russian revolution sent shockwaves through western states and financial markets. Anti-semites argued that Jewish involvement in revolutionary politics was part of a conspiracy by "the homeless wandering Jew" to replace European states with their "Hebrew nation". Winston Churchill, as secretary of state for war in 1920, wrote an article in the Illustrated Sunday Herald claiming there were three categories of Jews - good, bad and indifferent - and arguing that they were part of a "worldwide conspiracy for the overthrow of civilisation and for the reconstitution of society on the basis of arrested development".

Jews were the first non-Christian, yet monotheistic, religious minority in Britain. They are also one of its earliest "racialised" people. Despite important differences, the treatment of British Jews provides an illuminating comparison with contemporary anti-Muslim racism. There are recurring patterns in British society that racialise Jews and Muslims, which we need to understand if we are to develop an effective strategy for national security.

Jews and now Muslims have been and are the targets of cultural racism: differences arising from their religious culture are pathologised and systematically excluded from definitions of "being British". Both anti-semitism and anti-Muslim racism focus on belief in religious law to construct Jews and Muslims as a threat to the nation. Pnina Werbner, professor of social anthropology at Keele University, argues that Jews are predominantly racialised as an assimilated threat to national interests emerging at moments of crisis. Muslims are now being represented as a different kind of "folk devil" - a social group that is openly and aggressively trying to impose its religion on national culture. This partially explains the recent concerns about multiculturalism. "Anti-fundamentalist images provide racists with a legitimising discourse against Muslims," as Werbner puts it, which is used by "intellectual elites as well as 'real' violent racists".

The Jewish-Muslim comparison reveals another recurring pattern in recent British history: the rapid collapse of security fears associated with a religious minority into a racialised discourse of "civilisation versus barbarism". The American philosopher William Connolly predicted after September 11 that "the terrorism of al-Qaida, in turn, generates new fears and hostilities. The McCarthyism of our day will connect internal state security to an exclusionary version of the Judeo-Christian tradition".

The ease with which security fears can generate "moral panics and folk devils" was recently highlighted at a conference organised by London mayor Ken Livingstone to debate the neoconservatives' insistence that we now face a new clash of civilisation versus barbarism. In London's past, the East End British Brothers' League carefully framed its objections using terms such as aliens, anarchists and Bolsheviks rather than Jews. At last month's conference, many cheered as if at a rally, as these new advocates of "civilisational conflict" worked hard to keep separate their categories of barbarian and civilised. They cited Ayaan Hirsi Ali as their exemplar of a "good Muslim", thus clarifying the "civilisation" they are encouraging Muslims to emulate. Hirsi Ali, whose research is funded by the neo-conservative American Enterprise Institute, argues that the west should launch a war against Iran - with the prospect of the deaths of thousands more innocents - as it earlier agitated for war on Iraq.

The neocons want us to treat domestic security like the war against fascism. This manipulation of Europe's memory of its struggle against nazism mirrors the propaganda of some Muslims - the July 7 bombers who, citing Iraq, insisted that they were martyrs in a holy war; and those who portray domestic anti-terrorism policy as a new western crusade against 1 billion Muslims. The London mayor's refusal to lapse into such "war talk" is one factor that has so far helped to prevent fear of domestic terrorism from collapsing into a racialised conflict of civilisations in the heart of diverse London. This is not just about foreign neocon wars, or politically correct anti-racism, or multiculturalism - or even the defence of the human rights of British citizens who are Muslims. It is about the security of all British citizens. As Ken Macdonald, director of public prosecutions, warned last week, if we want to safeguard our security we must abandon delusions that we are fighting wars, and deal with terrorism in the context of criminal justice. With more terror arrests inevitable, and the prospect of new anti-terrorism legislation any day, the need to grasp what is really going on could not be more urgent.

· Maleiha Malik is a lecturer in law at King's College London.

· This is an edited version of lectures prepared for presentation at the Clash of Civilisations conference in London on January 20 and at Finchley Progressive Synagogue