Kim is the orphaned son of an Irish soldier stationed in India. Living a vagabond existence in India under British rule in the late 19th century, he earns his living by begging and running small errands on the streets. When Kim is rescued by the British, he is sent to school and trained as a secret agent. Kim is set with a choice to either follow a life of espionage, the spiritual way of Tibetan Buddhism, or a combination of the two.
Kim unfolds against the backdrop of The Great Game, the political conflict between Russia and Britain in Central Asia. The novel made the term "Great Game" popular and introduced the theme of great power rivalry and intrigue. It is set after the Second Afghan War which ended in 1881, but before the Third, probably in the period 1893 to 1898. The novel is notable for its detailed portrait of the people, culture, and varied religions of India. Kim is considered by many to be Kipling's masterpiece, and was directly responsible for his Nobel Prize for Literature in 1907.