Gandhara was a historic region of ancient India (which corresponds to
areas of north west Pakistan including Attock). Situated astride the
middle Indus River, the region had Taxila and Peshawar as its chief cities. It was originally a province of the Persian Empire and was reached (327 B.C.) by Alexander the Great. The region passed to Chandragupta,
founder of the Maurya empire, in the late 4th century B.C., and under Asoka was converted (mid-3d cent.) to Buddhism. It was part of Bactria from the late 3d cent. to the 1st cent. B.C. Under the Kushan dynasty (1st cent.–3d cent. A.D.), and especially under Kanishka,
Gandhara developed a noted school of sculpture, consisting mainly of
images of Buddha and relief’s representing scenes from Buddhist texts,
but with marked Greco-Roman elements of style. The art form flourished
in Gandhara until the 5th century, when the region was conquered by the
Huns.
Attock fort was completed in 1583 under the supervision of Khawaja Shamsuddin Khawafi, a minister of Emperor Akbar.
In 1759-60, Maratha forces had captured the Fortress of Attock.
In 1758, the Marathas under Raghunathrao and Tukoji Rao Holkar captured Attock by defeating Durrani forces in the Battle of Attock, 1758.
The last Sikh Kingdom (1799–1849) under Maharaja Ranjit Singh
(1780–1839) captured Fortress of Attock in 1813 from the Afghan Kingdom
(Attock then part of Afghanistan). Later Maharaja Ranjit Singh
Sher-e-Panjab put Sardar Javala Singh Padhania in charge of the fortress
of Attock which he, with a handful of troops, successfully guarded
against Afghan onslaughts.
Then in 1849 Attock went to the British who created a district named
it Campbellpur District. After 1947, the Pakistani Government renamed it
as Attock in 1970s.
The city's foundations were laid in 1903, and it was named Campbellpur after Sir Colin Campbell. The city was established near Attock fort.
That was major routes towards central Asia. The district was created in
April 1904 by the merger of Talagang Tehsil in the Jhelum District with
the Pindigheb, Fatehjang and Attock tehsils from Rawalpindi District of
the Punjab province of British India.
Attock's first oil well was drilled in Khaur in 1915.
It has an oil and gas field Dakhini near Jand.
Although Pakistan had become independent from Britain in 1947, it
wasn't until 1978 that the name Attock was adopted for the city.
During the partition of Punjab Province of British India, Attock District had a Muslim majority with minorities of Hindus and Sikhs.