Let me own up right away: I knew very little about Richard the Lionheart when I decided to write a novel about him. I can't now remember what inspired me, but in my head was the phrase "men in green tights". I find that as the time approaches to think about a new novel, ideas begin to form, as though I am consciously and anxiously scenting the air. Sometimes I wish that I could write the same book over and over, which is the essential nature of genre fiction – familiar, comforting and bland. Already I anticipate readers protesting about the liberties I have taken with the historical novel.

Richard has become an icon. The Royal Arms of England is his coat of arms, unchanged, and is now more famous as the motif on England football team's shirts than it ever was as the country's coat of arms. In heraldic speak these are three lions passant gardant. (They have also been called leopards.) It is not only the football team that has appropriated his imagined qualities of bravery and ferocity; outside parliament, at the peers' entrance, stands an enormous Victorian statue of Richard on a horse, his sword raised, the image of ferocity but also of magnanimity, which is suggested by a panel on the plinth that pictures Richard pardoning an enemy. There is one discordant fact: Richard was not English in any sense. In France he is regarded as French. While his father, King Henry II, lived mostly in England and encouraged the intermarriage of the Norman French with the locals, Richard himself spent much of his life in southern Europe, particularly in Poitiers, at his mother Eleanor's court. He was Eleanor's favourite son.

After his coronation in 1189, he spent only a few weeks of his remaining nine years in England, and in later life devoted himself to building a grand castle, Chateau Gaillard, on the Seine, from where he ruled his empire. He spoke the langue d'oc by choice, and probably the dialect of Occitan favoured in his mother's Aquitaine.

What distinguished Richard from his brothers and his peers was his addiction to battle. It is said that only one man ever unhorsed him in a joust, and that was William the Marshal, who is buried in the Temple Church, London. It seems certain, discounting the myth-making of the chroniclers, that Richard was a frightening and ruthless opponent. When a ransom was not paid on the due day, he had 30,000 Muslim captives slaughtered in full sight of Saladin's army. Even the Arab chroniclers close to Saladin – who were often more objective than the Christian chroniclers – describe him as a brave and terrifying warrior with no equal among the kings of the known world. Philippe of France fled more than once as soon as he heard that Richard was approaching.

After years of battles, he appeared to have no fear at all. During the third crusade, he learned that Jaffa had been taken unexpectedly, and he took ship from Acre in his galleys and sailed all night to Jaffa, where he leapt into the water ahead of his knights and waded ashore carrying his huge sword aloft, to retake the city in a few hours from the terrified defenders. He taunted Saladin's emissary: "This Sultan (Saladin) is mighty, and there is none mightier than him in the Land of Islam. Why then did he run away as soon as I appeared? By God I was not even properly armed for a fight. Look, I am wearing my sea boots." Richard was, however, fascinated by Saladin, and each understood the other's difficulties. When Richard fell ill, Saladin sent him iced water – melted snow collected in the mountains of Syria – and fruits from his orchards, which Richard craved.

Soon after, Richard sent a message for Saladin: "Greet the sultan from me and beseech him, in God's name, to grant me the peace I ask. This state of things must be stopped. My own country beyond the sea is being ruined. There is no advantage either to you or to me in allowing the present condition of things to continue." Richard's problem was the urgent necessity to get back to defend his lands against Philippe of France and his brother John. Both of them ignored the sacred agreement to protect his lands while he was on God's business.

The first suggestions that Richard may have been gay appeared in 1948. Yet John Gillingham, distinguished author of three biographies of Richard, does not believe that he was gay. He says the notion arose because Richard ignored for many years his betrothed, Alys, sister of Philippe of France, who lived at his mother's court. When he finally married Berengaria of Navarre, they lived apart and had no children. It was a dynastic marriage, designed to protect his southern borders against the counts of Toulouse. When Berengaria died she had never visited England, although her effigy in L'Abbaye de l'Epau, Le Mans, has her wearing the queenly crown of England.

Some chroniclers suggested that Richard was 6ft 5in , with flaming red hair, a sort of taller version of Prince Harry. But he also seems to have had a talent for composing and singing ballads. His grandfather was the first troubadour, and more or less invented the chanson de geste (song of heroic deeds), and Richard himself is reckoned to have been a fine troubadour.

Through the eyes of my narrator, Richie Cathar, I found myself pulled into the idea that history, both of the sort taught in schools and the sort that tries to make a nationalistic or religious point, are inherently unreliable – hardly a new thought, I know. The alchemy of what happens in the process of writing began to obsess me, as did the idea of novelstic truth. I spent hours reading manuscripts in the Bodleian and the British Library and looked for obscure accounts of Richard's battles and his attempts to recover the True Cross from Saladin.

I give Cathar these preoccupations. He meets a young woman in Jerusalem, and she proves to have a mysterious life that is never fully disclosed to him. At this point in the writing I found, almost without intending it, that I was writing a literary spy and quest novel, heavily influenced by both the Byzantine quality of Jerusalem and the sense that the follies and ancient longings and intrigues that have haunted Jerusalem – the preoccupations which nearly destroyed Richard the Lionheart – are as persistent as ever.

Lion Heart by Justin Cartwright is published by Bloomsbury.