At the end of the 19th century, Mohandas Gandhi was a young lawyer living in Durban, South Africa. He left his house in Beach Grove every morning for an office on Mercury Lane, where he spent much of the day helping his fellow Indian immigrants navigate the onerous colonial bureaucracy. He kept meticulous records, including a logbook of correspondence — from an English missionary and local planters, and a series of letters exchanged with the Protector of Indian Immigrants about the treatment of indentured laborers. In January of 1897, and again a few months later, he heard from another lawyer who was, like him, a Gujarati who had studied in England and then struggled to establish a practice in Bombay. The contents of these letters are unknown. In a remarkable new biography, “Gandhi Before India,” Ramachandra Guha gingerly speculates about what they might have been. Expressions of support for Gandhi’s nascent activism? Or perhaps “explorations of interest in a possible career in South Africa”? Guha wisely stops there. What is not in doubt is the name in Gandhi’s logbook — “M. A. Jinnah,” Muhammad Ali Jinnah, who would become the founder of Pakistan. “All we now know is that, a full 50 years before partition and the independence of India and Pakistan, the respective ‘Fathers’ of those nations were in correspondence.”

Guha’s description of this encounter is evidence of his strengths as a historian. He mines primary sources — in this case, records of Gandhi’s law practice from the archives in Pietermaritzburg, the capital of Natal, and the logbook dug out of a filing cupboard in the Sabarmati ashram in Ahmedabad, India — to establish that Gandhi and Jinnah were in contact a decade earlier than previously documented. And he writes vividly enough to compete with that bête noire of all Gandhi biographies, Richard Attenborough’s 1982 film “Gandhi.” (In the movie, they meet at a garden party in India, where a skeptical Jinnah adjusts his monocle while the turbaned Mahatma smiles beatifically.) Guha reminds us of everything these two legendary opposites had in common — language, education and the desperate striving of the ambitious immigrant. “Gandhi Before India” is full of such revelations, each one a delight for the reader.

Early on, Guha spells out how his technique differs from those of previous biographers: He uses the records of contemporaries to complement and sometimes challenge Gandhi’s own account. Gandhi was prolific — the first 12 volumes of his collected works run to 5,000 pages — but, Guha explains, “This reliance on Gandhi’s words can often narrow the historical landscape against which his life and work were enacted.”

This approach helps illuminate Gandhi’s time in South Africa. (As the title indicates, “Gandhi Before India” ends with his final departure, in 1914. A planned second volume will pick up the thread in India.) What Gandhi achieved legally for Indians in South Africa was modest, but by filling out the narrative with Gandhi’s colleagues and rivals, Guha makes a persuasive case that this period is just as significant politically as the years in India. Through the mutual wariness of Gandhi and John Dube, his neighbor and a pioneer of the South African freedom struggle, Guha sketches the marginal, often conflicted role of Indians in African nationalist movements. The frustrations of South Africa’s Gujarati Muslim merchants, Gandhi’s main political patrons, prefigure the mistrust that would later split apart the movement in India. Guha also uses the nervous functionaries of the Raj to show why Gandhi’s agitation in South Africa was so threatening to the larger colonial project — it forced authorities to acknowledge that under its veneer of liberal paternalism, the British Empire was built on racism. “Every patriotic South African looks forward to the establishment of a large and vigorous European population here,” the governor of Transvaal, Lord Selborne, wrote. “The immigration of an Asiatic population on a large scale he regards as a menace to the realization of this ideal.”