The Persian language, before the British colonized the subcontinent, was the region's lingua franca and widely used official language. It was replaced with English in 1835 by British East India Company.
From its earliest days, the language was brought into South Asia by various Turkic and Afghan dynasties. With the advent of the Turko-Afghan Delhi Sultanate and the Turco-Mongol Mughal dynasty, the language was grounded in the court and the administration. Beginning in 1843, however, English gradually replaced Persian in importance in South Asia as the British had full suzerainty over South Asia. Evidence of Persian's historical influence there can be seen in the extent of its influence on the languages of the South Asia. Many of these areas have seen a certain influence by Persian not only in literature but also in the speech of the common man. Persian exerted a strong influence on Urdu, and a relatively strong influence on Punjabi, and Sindhi in India and Pakistan. Other languages like Hindi, Marathi, Gujarati, Rajasthani and Bengali also have a sizeable amount of loanwords from Persian.
Persian language in South Asia Wikipedia
The basis in for the introduction of Persian language into the subcontinent was set, from its earliest days, by various Persianized Central Asian Turkic and Afghan dynasties. Thus, when the early Turkics and Afghans imported the language to the subcontinent, they laid the basis for its patronisation in the centuries to come, notably by the Delhi Sultanate (who were once again of Turko-Afghan origin) and the Mughals (who were of Turko-Mongol origin). There are many stone carvings and plasters of Persian inscriptions in India. There are also many handwritten books mostly from the time of Humayun, a Mughal emperor who had heavy admiration for anything West Asian, and Persian in particular. Humayun lost Mughal territories to the Pashtun noble, Sher Shah Suri, but, with the aid of the powerful West Asian Safavids, regained them 15 years later. Humayun's return from Persia, accompanied by a large retinue of Persian noblemen, signaled an important change in Mughal court culture, as the Central Asian origins of the dynasty were largely overshadowed by the influences of Persian art, architecture, language, and literature. There are many carved stones and Persian manuscripts in South Asia from the time of Humayun.
Subsequently, in a very short time, Humayun was able to expand the Empire further, leaving a substantial legacy for his son, Akbar. His peaceful personality, patience, and non-provocative methods of speech earned him the title Insan-i Kamil (انسان کامل), among the Mughals.