In the early decades of the 20th century, Britain buzzed with sinophobia. Respectable middle-class magazines, tabloids and comics alike spread stories of ruthless Chinese ambitions to destroy the west. The Chinese master-criminal (with his “crafty yellow face twisted by a thin-lipped grin”, dreaming of world domination) had become a staple of children’s publications. In 1911, “The Chinese in England: A Growing National Problem” (an article distributed around the Home Office) warned of “a vast and convulsive Armageddon to determine who is to be the master of the world, the white or yellow man”. After the first world war, cinemas, theatres, novels and newspapers broadcast visions of the “Yellow Peril” machinating to corrupt white society. In March 1929, the chargé d’affaires at London’s Chinese legation complained that no fewer than five plays showing in the West End depicted Chinese people in “a vicious and objectionable form”.

The historian Gregor Benton has argued that anti-Chinese feeling in Europe, the US and other white settler societies, at its peak a century ago, “was greater than that aimed at any other racial group”. And the Chinese remain a troublingly easy target in Britain today. After the 2004 Morecambe Bay tragedy, in which 23 Chinese immigrant labourers drowned when they were trapped by a rising tide, the Conservative MP Ann Winterton told a joke in a speech about a shark tired of eating tuna that decided instead to “go to Morecambe Bay for a Chinese”. Jeremy Clarkson, expressing his scorn for synchronised swimming in early 2012, described it as “Chinese women in hats, upside down, in a bit of water … You can see that sort of thing on Morecambe Beach. For free.”

In The Yellow Peril, Christopher Frayling draws on an impressive range of cultural references – fiction, film, theatre, music-hall, TV and playground doggerel – to plot the emergence of sinophobia in Britain, and to argue for its ongoing resilience today. He begins with the dramatic swing from the sinophilia of the European enlightenment, to the contemptuous racism of high 19th-century imperialism and beyond. One of the Victorian literary architects of the yellow peril was Charles Dickens who – in his essays and fiction – veered between mockery of China as a “glory of yellow jaundice” and dread of an insidious Chinese presence in Britain, eating out the heart of the empire. Dickens’s vituperative descriptions of opium dens in The Mystery of Edwin Drood generated crowds of literary imitators. In 1892, even the boys’ comic Chums dispatched a special “commissioner” to Limehouse, site of London’s Chinatown, to carry out a spot of reportage by investigating “the terrors of the opium den”.

The central character in Frayling’s account of the yellow peril is Arthur Sarsfield Ward, a former clerk of Irish-Birmingham stock who gained international fame as Sax Rohmer, creator of the bestselling Fu Manchu novels and propagator-in-chief of yellow-peril lore. Between 1912 – publication date of the first Fu Manchu story – and 1959 (when Rohmer published “the devil doctor’s” final fictional outing, Emperor Fu Manchu), Rohmer peddled fantasies about ruthless international Chinese conspiracies to his millions of readers. Fu Manchu, under Rohmer’s pen, is “the Yellow Peril incarnate in one man”: a man of mysterious malignance, possessed by an unexplained hatred of Caucasians and desire for global domination. At the height of Rohmer’s fame, Fu Manchu stories were to be found in public libraries, cinemas and the book collections of liners carrying Westerners out to China, ensuring (in the words of one such young traveller of the 1920s) that they “knew all about Chinamen; they were cruel, wicked people.”

The brand succeeded and lasted as it did by dancing artfully between hysteria and plausibility, mixing vague fears of the Chinese presence in Britain with topical headline stories and police reports about alleged Chinese webs of organised crime behind small businesses in Limehouse. It also slotted neatly into popular detective-story forms. The novels borrowed heavily from Conan Doyle’s blueprint for Sherlock Holmes, telling of the struggles of the narrator, one Dr Petrie, and his brilliant, mercurial friend, Nayland Smith, to detect hidden Chinese schemes (propagated by a Moriarty-like super-villain) up and down the land. Frayling carefully roots Rohmer’s plots and descriptions in the Edwardian music-hall – where Rohmer’s writing career began. In so doing, he reminds us that, despite its long-term influence on British and American attitudes to China, Rohmer’s portrayal of the Chinese was pure pantomime. “I made my name on China,” Rohmer himself openly admitted, “because I know nothing about the Chinese!”

Frayling’s deep knowledge of Edwardian sinophobia and its cultural manifestations is fascinating; his cultural history is both beautifully constructed and richly illustrated with vintage postcards, reproductions of book covers and posters, movie stills and cartoons. Some might counter, however, that his subject is a period-piece with little or no relevance to contemporary, multicultural Britain and the US. The formulaic cheapness of the Fu Manchu novels, and the campness of subsequent satires of the genre (from the Goons, via Monty Python, to the 1969 attempt to score a Broadway hit with the Fu Manchusical) might seem to implore a 21st-century reader to see the funny side. Indeed, the phenomenon of the yellow-peril parody is older than Fu Manchu himself: in 1909, PG Wodehouse took a swipe at yellow-peril-style fiction in The Swoop! Or How Clarence Saved England: A Tale of the Great Invasion.

Yet it is not so easy to dismiss the popularity and durability of the Fu Manchu phenomenon, the degree to which it exploited and reinforced anti-Chinese feeling in the first half of the 20th century, and its afterlives in attitudes to China. In probably every decade since its invention, the yellow peril has featured in anglophone consciousness, regardless of the reality of China’s political, social or economic capacity to pose a threat: from the “blue ants” of the Maoist era, to fears of unstoppable armies of ingenious hackers today. In 1938, only months after perhaps hundreds of thousands of Chinese civilians had been massacred by Japanese forces at Nanjing, Sax Rohmer was still warning of the imminent rise of a “Kubla Khan … who by force of personality will weave together the million threads and from his loom produce a close-knit China”, spreading dread through Australia and America.

In an eye-opening survey of media portrayals of China over the past 20 years, Frayling chronicles the survival of racist stereotypes – many of which are derived from the delusional narratives about Chinese malevolence and ruthless global designs written by Rohmer and his write-alikes. British coverage of the handover of Hong Kong to mainland China in 1997 often presented the returning Chinese as faceless, militarised hordes, driving out the dignified servants of the British empire. A rash of books published since the 1990s has predicted the imminence of US conflict with an aggressive, rising power, in such titles as The Coming Conflict With China. A former US ambassador to China has worried publicly about “the Fu Manchu problem: why America and China tend to think of each other as cartoonlike enemies”.

Given how easily Anglophone readers can now access superb reporting by dedicated China correspondents, the persistence of yellow–peril cliche in the non-specialist media that Frayling describes is disturbing. Learning English is a normal part of the Chinese school curriculum; the same cannot be said for learning Chinese in Britain. In the absence of deeper, more widespread engagement with China’s realities, Frayling argues, ungrounded prejudices too easily make their return.

Clearly, China’s ambitions as a rising superstate can clash with those of the west. Competition for global resources, and the political and military tensions this could generate, are genuine causes for concern. Such struggles, history tells us, have always accompanied the emergence of new powers. But Fu Manchu and his like have generated a lingering western fondness for ill-informed scaremongering. In almost any trouble connected with China, the old fears easily resurface. One example is the panic in 2007 that spread the idea of China exporting “poison” to the world through its faulty products: pet food, drugs, toothpaste, lead-painted toy trains. (After recalling around 21m toys manufactured in China, Mattel admitted that the “vast majority of those products that were recalled were the result of a design flaw in Mattel’s design, not through a manufacturing flaw in China’s manfuacturers”.) In The Yellow Peril, Christopher Frayling brilliantly chronicles a shameful history of racism, and warns against the assumption that it no longer exists.

• Julia Lovell is the author of The Opium War: Drugs, Dreams and the Making of China (Picador). To order The Yellow Peril for £19.49 (RRP £24.99), go to bookshop.theguardian.com or call 0330 333 6846.