In 1864, he was asked to become Principal of the new Government College Lahore in British India (now in Pakistan) and he accepted and went there. In 1882 he succeeded in helping establish the University of the Punjab. He dedicated himself fully to the study of the cultures of the Indian subcontinent. During this period he also helped establish many schools, libraries and literary associations in the Punjab region. He also travelled to a number of remote places such as Dardistan and Baltistan, and wrote several books.