The story of the Irish military diaspora, affectionately called the Wild Geese and lauded by the Aisling poets, is a long and sad one. The Wild Geese were forced to leave Ireland following failed rebellions and religious discrimination at home. This tradition dates back to the 16th century when Irish regiments were formed in Spain.

The largest exodus occurred in 1691 when the 14,000-strong Irish Jacobite army, supporters of the Catholic Stuart king, withdrew to France following defeat in the Williamite War. The French formed the different Irish regiments into an Irish brigade, as it was intended that they would land in Ireland within the year. They never did and instead went on to fight for France. The Irish Brigade went on to serve France for 100 years. They earned their reputation as first-class soldiers and were one of the best units in the French army.

An Irish Legion soldier’s regalia

One hundred years later, following the failed 1798 Irish Rebellion, there was a new wave of Wild Geese when many fled to France. Irish generals in the French army lobbied Napoleon for the creation of a new Irish corps, leading to the creation of La Légion Irlandaise. This new Irish unit, again, was intended to spearhead an anticipated invasion of Ireland. However, following the defeat of the combined Franco-Spanish fleet by Admiral Nelson at Trafalgar, all plans for an invasion were put on hold. Consequently, the Irish Legion went on to serve France in the Low Countries, Germany and in Spain. Just like their predecessors, the vast majority never again set foot in Ireland and were lost into history. The soldiers of Napoleon’s Irish Legion are perhaps the most forgotten of the Wild Geese.

I set Napoleon’s Blackguards – the first novel written about the Irish Legion of Napoleon – in Spain during the Napoleonic Wars. The book is based on the real-life travails of the Irish Legion’s campaign there. When Napoleon’s Grand Armée invaded Spain in 1808, the Spanish rose up against the hated French invader. Britain entered the war as allies of Spain to help remove Napoleon’s grip of the Iberian Peninsula and deployed a 50,000-strong British expeditionary force to Spain.

Gen Sir John Moore marched his army through the Spanish interior intending to fight a French force under Marshal Soult. He had to retreat when he learned that a far larger army led by Napoleon himself was advancing against him. He feared that his army would be enveloped in a pincer movement. Consequently, the British army, which included many of the soldiers’ families, force-marched for three weeks in atrocious winter weather, fighting a desperate rearguard action to reach Corunna, to ship them Dunkirk-style back to England. They suffered terribly and discipline broke down.

The French followed in hot pursuit and suffered greatly in the race to catch up with them. The by now ragged British army finally reached Corunna but was forced to make battle with the French before they could escape back to England.

Moore had saved the army but it had come at a terrible price. They had lost four thousand men, women and children, captured, frozen to death or cut down by the French during the retreat. The British commander was also killed. The focus on Moore’s epic retreat to Corunna has always been on British losses, but the French also suffered terribly in the pursuit of Moore, and were almost as exhausted. Some sources estimate Marshal Soult’s losses alone to be anywhere from 7,000 to 10,000 men, before he even made battle at Corunna.

Napoleon’s Blackguards, an action-filled adventure story set along the ancient pilgrimage route the Camino de Compostela of northern Spain, follows these events. The war in Spain, which Napoleon called his “Spanish ulcer”, became a bloody war of attrition. Terrible atrocities were committed on both sides. Many of the events that happened in the novel were derived from memoirs, such as the shooting of deserters, and were so horrific that I could not have possibly made them up.

The Spanish freedom fighters (called the guerrilleros) frequently ambushed the French columns as they snaked its way across the lonely, narrow mountain passes. No mercy was shown. Letters sent home by Belgian conscripts tell of bodies left hanging from trees. Francisco de Goya’s sketched these graphic scenes in his Disasters of War series (These sketches, incidentally, are owned by Dublin’s Chester Beatty Library).

There were many gruesome stories told and retold around the campfires to nervous teenage French conscripts. One can only presume that they listened in terror when they heard of the fate of their comrades. The account of the death of brave Colonel René and his family, captured by the guerrillas when they were returning to France, will not be recounted here, but suffice to say that it was particularly chilling.

The novel’s protagonist is Captain James Ryan who is wanted by the British for his part in the 1798 rebellion. Ryan narrowly escapes capture and manages to stow away to France and join the Irish Legion. The unit is made up of dubious characters, deserters and ne’er do wells, led by a band of former Irish rebels. They quickly earned their reputation as the worst blackguards in the French army.

Ryan’s Irish unit deploys to Spain and the British arrive to oust the invading French army from the Iberian Peninsula. Ryan is obsessed with catching up with Captain Darkford of the 4th Light Dragoons who murdered his family in Ireland. Ryan and his band of renegades play their rollicking Irish ballads as they pursue the evil Darkford across Spain.

Stephen McGarry: author of the first novel written about the Irish Legion of Napoleon. Photograph: City Headshots Dublin

Ryan is battle-hardened and brave, but he’s also flawed and struggles with self-doubt and guilt. He has to fight a series of duels, is captured and tortured by the Spanish guerrillas and has to lead a mission to retrieve their cherished battle-standard eagle. He is also suffering from post traumatic stress disorder. He doesn’t understand why he is having night sweats. He has been through a lot and at one stage, he can’t go on and puts his pistol to his temple but pulls back at the last minute.He told himself that it was just his nerves and that once he catches up with his nemesis all will be well. But it won’t. He has seen too much horror to come out unscatched. Even this will not make him give up his quest of catching up with the evil Darkford.

Napoleon’s Blackguards by Stephen McGarry is published by Penmore Press. It is on sale in paperback ($19.50/£14.35) and in ebook ($5.50/£4.20) from Amazon and in retail outlets