Their names stand high among the roll call of British men of letters of the modern age: both revered authors with an international following, but publishing in very different corners of the literary world. One, John le Carré, is the creator of a succession of brilliant spy thrillers, including The Spy Who Came in from the Cold and The Little Drummer Girl, the other, the late Eric Hobsbawm, was a leading exponent of leftwing historical thought, a man who was also the subject of state surveillance for many years.

Now the first biography of Hobsbawm, A Life in History, due out early next month, is to reveal an unlikely correspondence between the two men that centred on the name of a character in one Le Carré novel. In the 1986 book A Perfect Spy, later made into a BBC television series, Le Carré makes reference to a character called “Hobsbawn” who was under the control of the British security services. The real man, Professor Hobsbawm, was not pleased.

Speaking this weekend, Le Carré told the Observer he imagines that back in the early 1980s he had simply reached for a name that would have the right political associations for those familiar with leftwing theory.

“I can’t imagine from this distance that I was unaware of Hobsbawm’s distinction or his politics,” Le Carré said. “I suspect that what I did in midstream was picture a Marxist intellectual under MI5 control, and then give him an analogous name that would resonate with the knowing.”

The written exchange between the two in the mid-1980s was cordial, but there were glimpses of steel underneath. The Marxist historian requested the name be changed in all subsequent editions of the thriller. No such change was made.

Today Le Carré recalls writing Hobsbawm “an appropriately humble disclaimer” and receiving a courteous reply. “He acted with grace. I was grateful for his forbearance,” the novelist said. Hobsbawm, who died in 2012 at the age of 95, had been alerted to the offending page in A Perfect Spy by a reviewer.

“The name is I can assure you more consistently misspelt than any other I know. It is also entirely identifiable with a fairly limited number of real persons,” his first letter argued. Hobsbawm went on to concede that his legal case was shaky. “I don’t suppose anyone will regard a fictional membership of MI5 as actual defamation, though speaking as one who has had a file since at least 1942 it makes me slightly uneasy,” he wrote.

The academic was also curious, he added, to hear how it had happened. “My question is simply this: how on earth did you hit on the name? Is it an esoteric joke, something dredged up from among subconscious associations, or what?”

Le Carré, now 87, whose real name is David Cornwell and who was an intelligence agent for both security services in the 1950s and early 1960s, wrote back quickly to reassure him.

“I’ve no idea why I chose a name similar to yours, since I have never consciously heard of you, or your namesakes. There was no coy joke and I certainly wouldn’t risk some wasteful court action by doing such a thing. I choose names for their musical contrast & impact: yours (or mine) stuck out as a sort of optical and aural loner in the pack, something to set the fellow apart.”

Hobsbawm’s biographer, Richard J Evans, suggests, in contradiction, that it is “perfectly possible” that Le Carré had “picked up the name from a half-remembered file he had seen while working for the intelligence services”.

The matter did not end there. The professor wrote back to the author once again requesting a name change. His identification with the name in the book had already been made by a critic in the New York Review, he pointed out. “I am not pleased at the prospect of jokey conversations on the subject of my putative relations with MI5. We shall never find out whether it is actionable to put someone who sounds like me into your novel as a security official, because it would be both pompous and ridiculous to try to find out. But it is mildly uncomfortable to figure as such for someone who, like myself, has an old-established track record on the Marxist left.”

Nevertheless, the correspondence ended on a conciliatory note, with the professor revealing he was an admirer of Le Carré’s fiction. A Perfect Spy, the author has since said publicly, in fact drew heavily on his own difficult private life. It told partly of Le Carré’s troubled relationship with his father and writing it had been a cathartic exercise. “I cried and cried when it was over,” he has said.