A wide circle of influential friends were earnestly desirous of his promotion. In 1800, the opposition of the aged incumbent prevented his appointment as assistant and successor in the ministerial charge of his native parish. A proposal to appoint him Professor of Rhetoric in the University of Edinburgh also failed. He now resolved to proceed to Africa, to explore the interior, under the auspices of the African Association; but some of his friends meanwhile procured him an appointment as a surgeon in the East India Company's establishment at Madras. During his course at the University, he had attended some of the medical classes; and he now resumed the study of medicine, with such an amount of success, that in six weeks he qualified himself for a surgeon's diploma. About the same time, the degree of M.D. was conferred on him by the University of St Andrews.
Before his departure for the East, Leyden finished his longest poem, the "Scenes of Infancy," the publication of which he entrusted to his friend, Dr Thomas Brown. His last winter in Britain he passed in London, enjoying the society of many distinguished men of letters, to whom he was introduced by his former friend, Mr Richard Heber. He sailed for India[95] on the 7th April 1803, and arrived at Madras on the 19th August. In Hindostan, his talents and extraordinary capabilities in forming an acquaintance with the native tongues gained him numerous friends. He was successively appointed surgeon to the commissioners for surveying the provinces in Mysore, recently conquered from Tippoo Sultan; professor of Hindostan in the College of Calcutta; judge of the twenty-four pargunnahs of Calcutta; a commissioner of the Court of Requests in Calcutta; and assay-master of the mint. His literary services being required by the Governor-General, he left Calcutta for Madras, and afterwards proceeded along with the army in the expedition against Java. On the capture of the town of Batavia, having gone to examine the library of the place, in which he expected to find some curious Indian MSS., he caught a malignant fever from the tainted air of the apartment. He survived only three days, terminating a life of much promise, on the 28th of August 1811, in the thirty-sixth year of his age.