The conquest of India by the Mohammedans which began in the year 712 with the foundation of an Islamic State in Sindh and which continued ever since invasions of Mahmud of Gazni (1001) and Muhammad Ghori (1175) subjected Jainas, as also Hindus, to the same persecutions and oppressions at the hands of the new rulers. Thus the armies of Ala-ud-din Khilji, while marching through Gujarat in 1297-98, committed atrocities, and these are remembered even now. Holy idols were desecrated, temples were destroyed or converted into mosques, books were burnt, treasures were looted and many Jainas were killed. Similar atrocities were perpetrated by the fanatic Muslims also in the Deccan and the south when they destroyed the Dravidian states. Jainas had to suffer very much during these difficult times, and their number which had shrunk on account of numerous conversions to Shaivism and Vaishnavism diminished further. They could save themselves from the fanaticism of the Muslims by going underground. They shifted their libraries to underground vaults. Only the chosen few had an access to them, and the buildings in their holy places, which were similar to the tomb of Muslim saints, could keep the Islamic fanaticism at bay.
The fact that Muslim kings proceeded against Jainas with fire and sword and tried to convert them forcefully to their religion should not mean that the relationship between Muslims and Jainas was always inimical, it appears much more that influential preachers like the Arabian missionary Pir Mahabir Khamdayat, who came to India in 1304, succeeded in making many Jainas of the Deccan Muslims by his sheer eloquence, and there were often peaceful and friendly contacts between Jainas and Muslims. Ala-ud-din whom Jainas called "Khuni ", the bloody fellow, had given the Jaina poet Ramachandra Suri many presents, and Sultan Firoz Shah Tughlaq (1351-1388) had honoured Ratnasekhara, the author of Sripalacharita.
Particularly a few Mughals distinguished themselves by showing mercy to Jaina teachers. Emperor Akbar (1566-1605) showered kindness on the Swetambara abbot Hiravijaya and took so much active interest in the religious concepts of Jainas that there was even a rumour that he had secretly embraced Jaina-faith. At the behest of Hiravijaya, Akbar issued in the year 1593 an edict by which the five hills of Rajgir, the mountain Parasnath in Bihar and other shrines of Swetambaras were declared as places of cultural interest. The emperor forbade further the killing of animals in the surroundings of the holy districts, returned to Jainas the books which were robbed from them and did them many other good deeds. Akbar had also contacts with Hiravijaya's successor Vijayasena and with Jinachandra, the head of the kharatara-sect. Emperor Jeanie (1605-1627) attracted similarly initially Jinachandra and his successor Jinasirhha, whom he honoured with the title Yugapradhana, to his court and issued a Farman for the protection of Satrunjaya.
Shah Jahan issued a similar Farman, and his sons Murad Baksh and Aurangzeb (1659-1707) awarded the district Satrunjaya with its income of 2 lakhs as Inam to the court-jeweller Satidas, a Jaina. Ahmad Shah (1748-1754) did the same thing with the mountain Parasnath. It was awarded to Jagat seth (world businessman) Mahtab Rai and his successors, to secure for the Jainas in this way an undisturbed Pilgrimage.