In 1018 AD Mahmud of Ghazni, after sacking undefended Muttra, marched across Mainpuri on his way towards Kannauj. From this time onwards Mainpuri was invaded by Muslim rulers. It was at this period, according to the historical accounts that the Chauhans migrated from Delhi southwards, establishing themselves in Mainpuri District and spreading over the adjoining districts. Two important local divisions of the territory which now makes up the Mainpuri district were Rapri and Bhongaon, was said to have been founded by Rao Zorawar Singh. After the defeat of Jaichand in 1194 AD the victorious army marched southwards against the raja of Rapri and defeated him. In commemoration of the victory the name of the small village where the battle was fought was changed from Karkha to Fatehpur. However, Rapri remained the seat of government for several centuries under successive Muslim rulers. However, Bhongaon on the other hand, remained under the Hindu rules without interruption.
After several years of turmoil and confusion Syed Khizr Khan succeeded in 1414. Rapri was still in the hands of Muslim rulers but the rest of the neighbouring Doab was evidently as insubordinate as ever. Further, in 1426 Jaunpur king, Ibrahim Shah made another attempt on Delhi, but was defeated in a pitched battle and his force retreated by Rapri to their own country. In Akbar's great reorganization of his empire, the tract, which is now included in Mainpuri District was all included in the subah of Agra, and divided between the sarkars of Agra and Kannauj. These sarkars were further subdivided, for revenue purposes, into mahals, on each of which a certain fixed sum was assessed and from which a certain contingent of troops was levied. Under the rule of Akbar and his successors Jahangir and Shah Jahan, Mainpuri and its neighbourhood enjoyed a long quiet period, which continued unbroken during the long reign of Aurangzeb (1658-1707), though the rest of the empire was now suffering from the inroads of the Marathas.
Eventually, with the invasion of British rulers, Mainpuri became the headquarters of the civil administration and small cantonments were established at Shikohabad. This district was highly influenced by the freedom movements that started throughout the country. Thus, the history of Mainpuri District suggests that the region covered by the present district formed part of ancient kingdoms like Maurya Empire and Gupta Empire and of Harshavardhan.