As a schoolboy I was captivated by the romance of history. I’d imagine myself as great historical characters, Alfred the Great one week, Admiral Nelson the next. Once when the teacher asked my classmates what they wanted to do when they grew up – and they said they’d like to be firemen, doctors or policemen – I answered; ‘Lord High Protector of England, please sir.’

Of all the periods of history that I fantasised about, the Napoleonic Wars came top. The beautiful uniforms, the great causes, the extraordinary personalities, above all of course the long litany of bloody battles. By the age of ten I could recite the names of all the captains and the ships they commanded at the battle of Trafalgar, complete with the number of guns on each vessel. History was story-telling, romance, fun.

Then, when A Levels and eventually Cambridge history dawned, I had to do the unromantic slog through ‘real’ history – those social, economic and issue-related topics upon which the world really turned, far removed from the wonderful battles, assassinations and inspirational speeches of the history of my youth.

After having spent six years working on the biography of Lord Salisbury, which was published in 1999 and which won the Wolfson Prize, I decided to award myself a jeu d’esprit. I’d long wondered why, since the Emperor Napoleon was clearly a genius, he had so badly underestimated the Duke of Wellington on the morning of the battle of Waterloo, writing him off as ‘a mere sepoy general’ (i.e. one fit for nothing better than fighting in India), and boasting that he’d win the battle by lunchtime.

A man of Napoleon’s obvious and multifarious abilities must have known that Wellington was far more formidable than that, for had he not defeated six of the emperor’s own marshals during the Peninsular War? From that question the premise of my next book arose. It led to other questions, most importantly: What did Wellington think of Napoleon? How did their views about one another change over the years? Did the battle of Waterloo mark a watershed in their respective viewpoints? Did Napoleon ever admit his error?

There are of course literally thousands of books, papers, pamphlets and articles that have been written about Napoleon in the two centuries since he seized power in France in the Brumaire coup of 1799, and it is completely impossible even in one lifetime to read them all, let alone the two years I had given myself to write this book. Fortunately the glorious London Library in St James’s Square in London had most of them, so I settled down to explore the subject as deeply as I could in the time, consulting several hundred before I picked up my pen.

There, working alone at a desk among the shelves, I rediscovered the passion that had led me to love history a quarter of a century ago. Personalities such as Talleyrand, Metternich and Marshal Soult came back to me, with their schemes and plots and jokes – this book has plenty of jokes. Everyone asks writers whether they enjoy their work, and they often get rather pretentious replies about the ‘pain’ inherent in the creative process. I can honestly say that I adored writing this book and would love to do it all over again.