When Ahmad Shah Durrani formed the Durrani Empire in 1747, the Afghan Army fought a number of battles in the Punjab region of India during the 19th century. One of the famous battles was the 1761 Battle of Panipat in which the Afghan army decisively defeated the Hindu Maratha Empire. The Afghans then fought with the Sikh Empire, until finally, the Sikh Marshal Hari Singh Nalwa died and Sikh conquests stopped. In 1839, the British successfully invaded Afghanistan and installed the exiled Shah Shujah Durrani into power. Their occupation of Afghanistan was challenged after Wazir Akbar Khan and his forces led an organized revolt against the occupying British. At the time, the Afghan Army was not an organized army, rather, Afghan tribal chiefs contributed fighting men when the Emir called upon their services. The success of the uprising led to the 1842 retreat from Kabul where the Afghan army decimated British forces, thanks to effective use of the rugged terrain and weapons such as the Jezail.