Visitors to Connemara, that wilderness of stony beauty in the west of Ireland, sometimes stop at the village of Letterfrack. It’s a charming little hamlet, with thatched cottages and cosy pubs; picture-postcard pretty, on the face of it untroubled. Not far from the town is the manor where Yeats honeymooned. (Like many Great Houses, it is now a hotel.) Nearby you can stroll on a shingled beach. Sea-wrack, gull-call, Atlantic breezes — the strange loveliness of coastal places. There’s a sense of continuities, of things unchanged for generations. But that is illusory, the wishful thinking of the outsider. Modernity has indeed touched Letterfrack. ‘Father Ted’ might be playing on the TV in the bar. The guesthouses offer en suite bathrooms, as well as turf fires.

We tourists take pleasure in the emptiness of Connemara. There are reasons why such a silence exists. You would not think, as you amble the sleepy lanes, as you are stilled by the twilight descending on the mountain, that you are walking through a space that was once a disaster zone: the Ground Zero, perhaps, of Victorian Europe. These meadows, those pebbled fields, saw astonishing suffering. There was heroism, too; there was extraordinary courage and love. But these wine-dark boglands and rutted boreens witnessed tragedy so immense that those who observed it, like Grantley Dixon in my novel, would never forget the sight.

All this happened in the 1840s, that decade in which a million of the Irish underclass died as a consequence of famine. Residents of the richest kingdom on earth, they lived only a few hundred miles from the empire’s capital, London. But that did not save them; nothing saved them. Abandoned by the dominant of Ireland and Britain, perhaps two million of the desperate became refugees. We might call them ‘asylum seekers’ or ‘economic migrants’. They fled their homeland by any means possible, often on ships like the Star of the Sea. Their language, Gaelic, among the oldest vernaculars in Europe, already in decline, virtually disappeared overnight. ‘Mharbh an gorta achan rud,’ one Gaelic speaker remembered. ‘The famine killed everything.’

Like the age we live in now, this was an era of technological advances, of artistic brilliance and scientific progress. Great novels were written; there would be revolutions all over Europe; democracy began to flower; new engines were invented. But little of that mattered to the starving of Letterfrack, as little enough of it matters now to the starving of Africa. The world was organised as a pyramid of power, with the affluent at the summit and the poor bearing their weight. Those who worked the hardest possessed the least wealth. Those who did nothing at all owned the most. Down at the very bottom were the nobodies of Connemara: white Ethiopians of the Dickensian world.

Tens of thousands of them died. Whole communities, sometimes. Many thousands more would also have perished, were it not for the efforts of two gentle English people. James and Mary Ellis were a prosperous couple from the industrial city of Bradford. (Like Captain Lockwood in my novel, they were Quakers or Friends.) Despite having no familial or business connection with Connemara, they moved from Yorkshire to what is now Letterfrack in 1849, where they paid for the building of cottages and roads, a school, a food store, a doctor’s dispensary. They employed the locals fairly and treated them with respect. The couple, who were elderly by the standards of the time (most people died in their sixties in the 1840s) forsook the comforts of home and privilege to live in solidarity with the poorest of the poor. They were not politicians, nor were they missionaries. Indeed, they were motivated by nothing more than compassion, a faith in the certainty that we are all connected, no matter what we are told by our rulers. They believed that the world need not be a slum; that we live in a society, not just an economy; that every human life is unutterably precious. The imagery of holocaust is sometimes used about the Irish famine. If that’s what it was, James and Mary Ellis are our Schindlers. There should be a statue of them on Dublin’s O’Connell Street — but there isn’t, of course. The possibility of the famine story including heroes who were English was not part of Ireland’s thinking for a very long time.

It was not part of my own thinking when I came to write Star of the Sea. The novel’s beginnings were more intimate and tentative. About seven years ago, the image began to come to me of a criminal walking the decks of a 19th century tall-ship at night. In my mind’s eye I saw him as a haunted, lonely man, who had once been good, and who yearned to be again, were it not for a past that boiled with secret shames. I had never written historical fiction — nor had I read much of it — so I was surprised by the persistent drifting into my consciousness of this limping ghost. Wherever the apparition came from, I was intrigued by who he was. I wanted to know his story.

The nightwalker turned out to be Pius Mulvey, a central character in Star of the Sea. If Mary Duane is the book’s hero — and to me, she is — it is Mulvey who lives at the centre of its web. The novel’s opening pages describe him exactly as he was when he shuffled out of the ether and into my life. I didn’t know it then, but he would become my close companion. Mulvey and I would spend many an hour together, as the book slowly sprouted out from that first sighting of him. Who were the women in this mischief-maker’s past? Was he Jack the Lad or Jack the Ripper? What transgressions had he done? Who were his enemies? As I began to think of what was happening in my part of the world in Pius Mulvey’s era, it became clear that this would be a novel set during the famine.

I had the notion that he might once have been a singer or a song maker. I don’t know why, it just seemed right. And other characters were suggested by the Irish ballad tradition, too: that complex and deeply beautiful body of art created by geniuses whose names we will never know. Irish (and English) songs of the age feature landlords and labourers, police and thieves, star-crossed lovers, betrayed serving girls. David Merridith and Mary Duane had their birth in song, as did Merridith’s father, and the mudlarks of London, and the Liverpudlian recruiting sergeant who tempts the Mulvey brothers with the King’s shilling. I tried to take these archetypes and write about them as though they were real — just as Mulvey, one of several aspiring artists in the novel, borrows the melodies of the past and fills them up with new words.

There have been relatively few novels about the Great Famine. Joyce, Wilde, Yeats, Beckett — the gods of Irish literature hardly mention it at all. As the critic Terry Eagleton has observed: ‘If the Famine stirred some to angry rhetoric, it would seem to have traumatized others into muteness.’ Certainly, to read contemporaneous accounts is harrowing. Even to glance at the bare statistics is unforgettable. In 1841, four years before the start of the catastrophe, the recorded population of Ireland was 8,175,124. In 1851, the year after it ended, it had fallen to 6,552,385. The historian RF Foster has noted that by the 1870s there were three million Irish immigrants living in America – 39% of all those alive who had been born in Ireland. Inevitably, there is scholarly disagreement as to the reliability of the 19th century records. But most agree that Ireland’s population today is three million less than it was on the eve of the Great Famine.

A character in Roddy Doyle’s novel The Commitments jokes: ‘The Irish are the blacks of Europe.’ How true that was in the time of Mary Duane. And the comparison was made with notable frequency in the 19th century. (In 1892, even Sidney and Beatrice Webb, those sanctified champions of the British Left, remarked of a visit to their neighbouring island: ‘We detest them, [the Irish] as we should the Hottentots.’)

As I sketched out the novel, its intentions slowly cohered: without hatred or propaganda, to tell the story of this astounding cataclysm, of the culture that allowed it to happen. To celebrate the courage of those who were betrayed; to honour those who attempted to live with love and dignity in a world that regarded them as surplus to requirements. But beneath all that, what I was trying to do was something much more personal: simply to learn the story of Mulvey, my ghost. Where did he come from? Where was he going? Why was he traipsing those starlit decks?

I studied 19th century fiction to try to get the background correct. And I found that I loved those well-upholstered stories from the era when the novel was still a relatively young form. The early novelists had a license to make mistakes, I suppose, and I was excited by the punkish verve of their work. There was also the belief, during the novel’s adolescence, that words could portray absolutely anything. Authors were so tenaciously ambitious for language. Dickens, the Brontës were such daring writers, unafraid of large casts of characters or real historical events. To borrow a line from Spinal Tap, they weren’t afraid to turn the amp up to eleven. No setting was too epic, no technique of narration too audacious. Some novels in our own time seem watery by comparison.

I read first-person accounts by 19th century sea travellers, and eye-witness testimonies of conditions in Ireland and England at the time. Much of this novel is set in 1840s London; the pioneering journalism of Henry Mayhew brought that gloriously gaudy metropolis to life for me. Other sources included ballad-sheets, collections of immigrant letters, engravings from old journals, ships’ logs and manifests. But my hope was to write an engaging novel, not a work of history or a textbook. I used nothing that wasn’t a direct help in building characters or telling a story.

I must admit that I don’t care for many historical novels, with their diligently researched stenches and obsession with inadequate dentistry, their rumbustious heroes and capering paupers. Indeed, while I hope that my book is faithful to the verities of the past, I don’t think that being a chronicler alone is enough of an aim for a novelist. So the book touches on many preoccupations of our 21st century: sex, the body, gender roles, parenting, music, terrorism, war, religious intolerance. More than that, I hope it also celebrates the solidarities which fill life with joy: friendship, loyalty, home, commitment, the bravery of the emigrant, the indomitable boldness of human desire. Star of the Sea has been read in different ways, but to its author, at any rate, it is simply a story about love.

The book took a deal of planning, before ever a word was written. I sensed that it would need many disparate elements, but to discover the order that might make the structure float — that took work and time. Every novel has a secret architecture, and it’s important to get that right. Writing is an art, but it is also a craft. It felt important to use a wide variety of storytelling strategies, differing perspectives, voices and time zones — even some laughter, as a kind of hope. The background would be dark: I tried to flood it with light. Otherwise, the book might turn out to be yet another slab of windswept Irish misery, which would sink before its voyage even began.

The thriller, the mystery, the romance, the Gothic suspense tale: all these have traces in Star of the Sea. Merridith is a Jeckyll (and a Douglas Hyde), Mulvey an Irish cousin of Frankenstein’s freak. He is the Artful Dodger with a Galway accent, the trickster who scuttles through folklore gleefully ruining the crops. And behind all that, he is a frightened outcast, desperate to cast off these roles even as he stumbles further into them. The reader needs to be drawn into a novel through its language and atmosphere, through the struggles of recognisable characters, their choices and rejections, and should only absorb whatever it has to say about history through a kind of unnoticed osmosis. First and last, a novel must be an involving read. As David Merridith is fond of claiming: ‘Everything is in the way the material is composed.’

But that isn’t the whole truth. Composition is not everything. At the nucleus of the story of the Star of the Sea are real events, real men and women. To regard such a tragedy as raw material for a novel may be morally ambiguous, to put it mildly. But as Grantley Dixon insists, to remain silent is to say something powerful: that it never happened; that it did not matter; that there was never a Letterfrack, never a Mary Duane, no brutal Commander Blake, no merciful James and Mary Ellis. People like my characters all existed at the time. More to the point, they exist now, too.

On Cashel Hill, Connemara, there is a famine-era cemetery that is still in use today. Ard Cashel in Gaelic (‘High Cashel’ in English) is one of those lofty and lonesome places that the folk music shared by Ireland and Appalachia somehow translates into sound. Atlantic windstorms buffet Cashel Hill; the trek up is sheer and arduous. On the afternoon I last made the climb, Christmas Eve 1999, a small stars-and-stripes pennant had been placed on a tombstone. It marked out the grave of a young man of Cashel whose family had American connections, as have numberless Connemara people. He was too young when he lost his life, so very far from home. He should be alive today, dandling grandchildren, but that was not to be his emigrant’s fate. Born in Galway, he would die on the far side of the planet, on 31 March 1969 — a few months short of his twenty-second birthday. Locals recall that on the icy morning when the American military came to bury him, the jeep that bore his casket could not manage the steepness of Cashel Hill. So he was carried up the mountain to his final resting place, up the rocks to Ard Cashel, as his ancestors had been before. He lies among those others whose names are long forgotten, who were abandoned in the latitudes of hunger.

His grave is a reminder of many things: among them, the awful cost demanded by patriotism, the wrongs we have done to one another for love of country, the dreadful waste that is racism, all those unaccepted friendships, but the hope that the world can yet be a fairer place. I respectfully add his name to the text of this novel, in memory of his short life and of all the nameless who lie around him — or wherever in the land of Connemara they lie.