In 1738, Nader Shah of the Persian Afsharid dynasty invaded Muhammad Shah's Mughal Empire. Nadir Shah defeated the Mughal Empire in the Battle of Karnal and proceeded to sack Delhi. During the panic before and after the Battle of Karnal, important functionaries of the Mughal Empire fled Delhi but were intercepted by small jathas of the Dal Khalsa and relieved of their wealth. Nadir Shah then gave Muhammad Shah back his title of Mughal Emperor but took away his royal treasury, including the Peacock Throne. When Nadir Shah began his retreat, the Sikhs who had been seeking refuge in the Sivalik Hills came down from the mountains and mercilessly plundered the treasure of the Persian Army. Afterwards the Dal Khalsa established a fort at Dallewal near the Ravi river and began levying taxes in the area around Lahore.