Attock Fort () was built at Attock Khurd during the reign of Akbar from 1581 to 1583 under the supervision of Khawaja Shamsuddin Khawafi to protect the passage of the River Indus. Attock was briefly captured on 28 April 1758 by the Maratha Empire and became the northern boundary of the Maratha Empire. Ahmad Shah Durrani recaptured Attock and halted the Maratha advance in the north permanently after the Third Battle of Panipat. It featured a prominent role in Afghan-Sikh Wars during the Battle of Attock.