Abdali invaded India a fourth time in 1757 A.D. He penetrated to Delhi and Mathura, carried away a lot of loot. The Punjab was annexed, one Najib Khan Rohilla appointed governor. The Marathas counter-attacked Abdali's forces in the Punjab and sent his son whimpering to his father across the Indus. In return, Abdali invaded India again as a result of which the remains of the Moghul kingdom practically disintegrated. Alamgit II was murdered by Ghaziuddin himself. A youth named Muhiul Millat, son of Muhius Sunnat and grandson of Kam Bakhsh, was crowned kind with the title of Shahjahan II. But he failed to get any recognition. Ghaziuddin and the new emperor fled precipitately. On September 23, 1760 A.D. the Marathas under General Sadashivrao Bhau besieged Delhi and later took it by storm. On October 9, 1760 A.D. they deposed Shahjahan II and declared Mirza Jawan Bakht, the grandson of Alamgir II, as emperor. The murdered emperor Alamgir II's son, Ali Gohar, scared for his life, left for Bengal. There he took shelter under the British. This was the beginning of the proud Moghul sheltering under the British canopy for protection. There he assumed the title of Shah Alam II and declared himself the king while Delhi was in reality controlled by a Muslim clan called the Rohillas. Shah Alam was a virtual prisoner of the British General Smith at Allahabad. At their dictates, in 1765 A.D. Shah Alam II bartered away to the British the imperial right to collect the revenues of Bengal, Bihar and Orissa in return for an annual pension of Rs. 26 lakhs. Thus, the Moghul ruler was reduced to a mere pensioner!
Somehow the Marathas got hold of Shah Alam II and made him the emperor on January 6, 1772 A.D. The inveterate Rohilla enemy of the Marathas, Najib Khan Rohilla had died in the meantime. His grandson Ghulam Kader rose against the titular pensioner emperor Shah Alam II. Ghulam Kader turned into an inveterate robber. His lust for wealth was insatiable. Day in and day out, he would ransack and rummage the remotest recesses of the imperial palaces for treasure troves.
In 1788 A.D. Shah Alam's women and children were dragged out into the open and mercilessly kicked and flogged and Shah Alam was brutally blinded. The horrid atrocities of Ghulam Kader are graphically described by Fakir Khairuddin Mohammed in a chronicle called Ibratnama. The women of the royal harem were molested in the most atrocious and weird manner. As a climax to the horror drama, a painter was summoned post haste and commissioned to do an on-the-spot painting of Ghulam Kader sitting on the chest of Shah Alam II, dagger in hand, and neatly scooping out his eyes.