The Indus at Attock is narrow, fast and deep, and for a long distance in either direction it is the only place a crossing can be held. Everything about the fort follows from that one fact.
The river is also the edge of the Punjab proper. Beyond it the country, the language and the politics change, which is why every power that held the plain either stopped at this line or came to grief past it.
The fort at Attock was built by Akbar between 1581 and 1583 to hold the Indus crossing, and it is the point at which every invasion from the north-west had to be met or let through.
Ranjit Singh Ji took it in 1813 and the battle of Attock that year, against an Afghan force under Wazir Fateh Khan, was a decisive Sikh victory, though not the first over an Afghan army, since Sikh forces had won at Gujranwala in 1761 and at Sirhind in 1764. The frontier moved to the Indus and then past it.
It is in Pakistan. The double-decker bridge below the fort, carrying road and rail, opened in 1883.
The fort's walls run down to the water and the crossing below has been the entry into Punjab from the west for as long as there is a record of anyone entering. Alexander, Babur and Nadir Shah all used it.
Holding Attock is what made the Sikh state a frontier power rather than a Punjab power. From here the campaigns went on to Multan, Kashmir and Peshawar, and Hari Singh Nalwa Ji held the line at Jamrud.
The fort is in military use and is not open. The town was called Campbellpur from the British period until 1978, when it took the name of the fort.