He was one of Britain’s most celebrated writers of the 20th century, the Nobel prizewinning author of The Jungle Book. But Rudyard Kipling’s work for British intelligence during the first world war has been lost in the mists of time.

Now new research has highlighted the extraordinary role the author of Kim and the poem If played in pushing out pro-empire propaganda designed to temper the threat of an insurrection among Indian soldiers fighting in France.

Rudyard Kipling’s writing enjoyed by Indians | Brief letters Read more

Dr Gajendra Singh, a historian at Exeter University, has been combing the archives of British intelligence for his forthcoming book, Spectres of Violence. He has revealed how, in the second decade of the 20th century, some 14,000 Indians living in the US were becoming an acute concern for the secret services. Drenched in pre-Bolshevik idealism, many were plotting revolution and the overthrow of the Raj. A powerful clandestine German intelligence unit – known as the Information Centre for the East – saw them as useful pawns and tried to manipulate them with anti-British propaganda.

“Around half of the expats return to India in 1914 to sow insurrection, to smuggle arms and explosives, and to develop cellular networks,” Singh said. “They are responsible for a near insurrection in the early months of 1915. What causes most concern among the British is that these guys are pensioned soldiers. They know what they’re doing. They call themselves the Ghadar movement – Urdu for mutiny or rebellion – and they are constantly harking back to 1857.” This was the year of a bloody but unsuccessful uprising against the East India Company – an event that the British authorities were desperate to ensure would not be repeated.

British intelligence was also worried about the thousands of troops India had sent to fight in France. Agents were monitoring their letters home to record any anti-British sentiment that could possibly mutate into insurrection. At the same time there was growing collusion between Irish and Indian revolutionaries, fostered by German intelligence, which spread stories about how poorly Indian soldiers were being treated.

“Kipling was recruited by British intelligence in the first world war to write for American journals under his own name, to show the British in a positive light and undermine Indian nationalists,” Singh said.

“In 1917 he’s asked by a branch of British intelligence to write a form of fictional Indian correspondence. He was given real letters sent home by Indian soldiers and asked to write his own version in order to spread propaganda in the United States.”

Kipling was already making regular visits to Ireland to recruit troops for the war effort. Devastated by the death of his only son, 18-year-old John, in the battle of Loos in 1915, Kipling acted out of patriotism, Singh believes.

“By this stage he’s a major literary figure,” Singh said. “His son has just died and he’s engaging in these tours to bolster recruitment in Ireland. He does it as a way to salvage his son’s memory, to do what he can for the war effort.”

An illustration of representatives from Indian regiments fighting to the British in the first world war. Photograph: Getty Images

It was the era of pulp fiction, when weekly magazines were popular, and Kipling’s letters were read avidly by audiences around the world. The letters sought to capture the essence of the Indian soldier abroad and painted his relationship with Britain in glowing, paternalistic terms.

“He writes them to show how infused with loyalty and deference the Indian soldiers were to the British,” Singh said. Much is made by Kipling of the Indian soldier’s naivety, his astonishment at the achievements of Britain.

A soldier who is recovering in Hampshire recounts how “when the emperor commanded me to his palace to receive a medal I saw all the wonders and entertainments of the city of London”.

He talks about visiting a “palace filled with carpets, gilt furniture, marble, silks, mirrors, velvets”, and which had “hot water [that] ran in silver pipes”.

“The idea is to try to construct the good Indian against the bad,” Singh said. “Britain wants to show that the majority of Indian opinion is on our side and that these Indians [plotting insurrection] aren’t representative of the whole.”

Kipling’s role in spinning for the empire is unlikely to surprise his critics. George Orwell described him as a “jingo imperialist”. In recent years, as British colonialism has become an ugly subject, Kipling has fallen out of favour.

But Singh suggests that Kipling is ripe for a spot of revisionism. “He’s not terribly fashionable now,” Singh said. “It’s a bit unfair as his work is far more ambiguous than it is being read now.”