On November 8, 1861, Captain Charles Wilkes, in command of the United States navy steamer San Jacinto, intercepted and boarded the British packet Trent on the high seas off the Bahamas.

Wilkes then forcibly removed James Mason and John Slidell, two former US senators who were on their way to Europe as "commissioners", or envoys, for the fledgling government of the Confederate States of America. Mason was bound for London and Slidell for Paris.

Britain had already declared its neutrality in the conflict between the American North and South but neutrality hardly meant idling on the sidelines. As the war grew bloodier and the stakes higher, it seemed almost inevitable that Lord Palmerston's Liberal government would find itself drawn into the conflict.

The fact that Britain, over four long years of tribulation, successfully, if not always skilfully, walked the tightrope between North and South is the subject of Amanda Foreman's tour de force.

Northern politicians and editors were jubilant about Wilkes's caper. Not only had the daring captain captured two prominent Confederate "traitors" but he had also given those arrogant Brits their comeuppance to boot.

Twisting the imperial lion's tail was an elemental part of American public debate and no one twisted it harder than Lincoln's voluble, blustering secretary of state, William Seward. The fact that Wilkes, in illegally boarding a neutral vessel, had also violated a fundamental principle of American foreign policy seemed not to matter, at least not initially.

The British were outraged by this American act of piracy. Palmerston saw war around the corner. Eleven-thousand troops were dispatched to Canada. The foreign secretary, Lord John Russell, floundered over London's response to America's insult.

The issue hinged on whether Wilkes had been acting under instructions or on his own hook (the latter, as it turned out). Curiously, it was Prince Albert, just before his death, who rewrote Russell's draft protest and provided the wording that allowed both countries to wiggle out of the fraught confrontation. Mason and Slidell were released from their Baltimore imprisonment two months later and sent on their way.

And so it went, one potentially explosive issue after another. The Confederate States desperately wanted British recognition and at the outset were confident they could win it. After all, the South provided 80 per cent of Britain's cotton imports for the mills of Lancashire and five million Englishmen depended on the spinning. Moreover, the South was more "Anglo", more cavalier, than the North, which teemed with German and especially Irish Catholic immigrants.

As the war went on and Robert E. Lee's Army of Virginia defeated the Union forces in one horrific battle after another, the courage and the nobility of the Southern struggle appealed to British popular sentiment.

But the Union had plenty of cards too. British exports and investment were directed more towards the industrialised North than the plantation South and despite the punitive customs duties imposed by the Morrill Act, British banks knew which side their bread was buttered on. British recognition of the Confederacy would have caused the North to declare war and Canada was the North's great hostage.

Most importantly, a Northern victory would secure the abolition of the South's "peculiar institution" of slavery, although this was an ambiguous war aim (some slave states remained within the Union and Lincoln's Emancipation Proclamation in 1863 applied only to the states in rebellion).

Britain was solidly abolitionist, though many British leaders (Gladstone, for example) convinced themselves that an independent South would abolish slavery anyway. The argument was hopeful but hollow.

Overseeing the tense bilateral relationship were two diplomats, the unprepossessing but perceptive Lord Richard Lyons in Washington and the frustrated, self-absorbed son and grandson of two former presidents, Charles Francis Adams, in London.

They patrolled the brink. The construction of Confederate warships in "neutral" Britain was a constant source of diplomatic tumult for Adams. Lyons was overwhelmed by the practice of forcibly "crimping" — coercing — British subjects into the Union or Rebel armies.

During the American Civil War, it seems you couldn't swing a cat without hitting a Brit. British blockade-runners, operating out of the Caribbean, turned huge profits during the conflict.

An American general's staff on either side appeared incomplete without an English officer. With 2.5 million expats in the divided country, the military was filled with English, Scots and Welsh.

The Anglo-American relationship during this cataclysmic conflict is an immense topic long neglected. Fresh from her 1999 Whitbread prize for Georgiana, Amanda Foreman has dedicated 12 years of impeccable research to mastering the subject.

The result is a book that melds great events with colourful characters and some of her footnotes merit chapters of their own. In transatlantic relations, things always look different and more interesting when viewed from mid-ocean and it is from this perspective that Foreman has presented her fine work.

A World on Fire: An Epic History of Two Nations Divided By Amanda Foreman, Allen Lane, 704 pages, £30