Attock finds its name in the history books dating to the rule of Ashoka, the Budhist Emperor of upper India. Supposedly Budhism had taken root in northern Punjab. After Asoka there is no direct mention of the district, and the period is in darkness. Doubtless the whole tract formed part of the Kingdom of Ederatides the Greek, who extended his power over western Punjab. The Indo-Greek kings held the country after him, being at last ousted (about 80 B.C.) by the Indo­-Scythians. At any rate, when Hiuen Tsang, the most famous Chinese pilgrim, visited the district in A.D., 630 and again in A.D., 643, Budhism was rapidly declining. The Brahman revival, to which, India owes its present form of Hinduism, had already set in the early years of the fifth century, and must have been at its height in the days of Hiuen Tsang. From the time the light afforded by the records of the Chinese pilgrims faded and a long period of darkness swallowed up the years that intervened before the Muslim invasions and the beginning of continuous history. The country was under the dominion of the Hindu kings of Kashmir, and probably so remained till end of the 9th century. After that, the district formed part of the Kingdom of the rulers of Kabul, Samanta Deva and his successors (more accurately designated as the "Hindu Shahis of Kabul") who remained in possession till the times of Mahmud Ghaznavi. With the passage of time, the Gakkhars became strong in the hills to the east, but their dominion never extended beyond the Margalla pass and the Khari Moorat.Attock Khurd (the old city) has a rich history. The great mathematician and grammarian Panini ,who wrote Ashtodhyaya, the oldest surviving Sanskrit grammar, was born near Attock in Shalatura, modern Lahur, on the right bank of Indus River in the ancient Kambojan/Gandharan territory in 520 B.C.E.. In those days Attock was located on the high road, the Uttarapatha, the principal route of international commerce and communication between Persia and China.
Attock then finds its name in the history books dating to the rule of Chandragupta's grandson Ashoka, the Buddhist Emperor of upper India, who had converted to the Buddhist faith. In the Edicts of Ashoka, set in stone, some of them written in Greek, it is declared that Greek populations within his realm also had converted to Buddhism:
"Here in the king's domain among the Greeks, the Kambojas, the Nabhakas, the Nabhapamkits, the Bhojas, the Pitinikas, the Andhras and the Palidas, everywhere people are following Beloved-of-the-Gods' instructions in Dharma." Rock Edict Nb13 (S. Dhammika).In the spring of 326 B.C.E. Alexander III of Macedon passed into the Punjab (at Ohind, 16 m. above Attock), using a bridge over the Indus constructed by Perdiccas and Hephaestion. The region became part of the Kingdom of Ederatides the Greek or Indo-Greek Kingdom, who extended his power over western Punjab. The Indo-Greek kings held the country after him (until about 80 B.C.E.) until its invasion by the Indo-scythians.
When the Chinese pilgrim Hiuen Tsang visited the district in 630 C.E. and again in 643 C.E., Buddhism was rapidly declining. The Brahman revival, to which India owes its present form of Hinduism, had already set in the early years of the fifth century, and must have been at its height in the days of Hiuen Tsang. From that time the light afforded by the records of the Chinese pilgrims fades.The country was under the dominion of the Hindu kings of Kashmir, and remained so till the end of the 9th century. After that, the district became part of the Kingdom of the rulers of Kabul, Samanta Deva and his successors (more accurately designated as the "Hindu Shahis of Kabul"), who remained in possession till the times of Mahmud Ghaznavi. With the passage of time, the Gakhars became strong in the hills to the east, but their dominion never extended beyond the Margalla pass and the Khari Moorat.
Mughal, Maratha, Afghan and Sikh rule
Akbar the Great built Attock Fort from 1581 - 1583 under the supervision of Khawaja Shamsuddin Khawafi to protect the passage of the Indus. Attock was won by Marathas led by Peshwas (Prime Ministers of Maratha rulers, based in Pune] between 1751-1760. The cousin of then Peshwa Balaji Bajirao named Raghunathrao had won Attok. It saw countless battles and skirmishes between the Sikhs and the Afghans in later years.
When Ranjit Singh sought to include the Sikh states south of the Sutlej within his jurisdiction, in 1808 the heads of these states sought and obtained the protection of the British, whose territories had now extended to their neighbourhood. The British sought alliances with Lahore, as well as with Kabul, for protection against supposed French designs on India. A British envoy, Charles Metcalfe, was received by Ranjit at Kasur in 1809 and the alliance was formed. In 1813 Ranjit Singh secured Attock Fort as well as the Koh-i-Noor diamond, consolidating his control over the Punjab.British ruleAttock District was constituted in 1904. The district was named Campbellpur (Campbell town) - after Sir Campbell who laid the foundation stone of Campbellpur City in 1908 a few kilometres south-east of old Attock Khurd town. In 1857 at the village of Gheb 143 people were killed during the Indian Rebellion of 1857.
After independence.Although Pakistan had become independent from Britain in 1947 it wasn't until 1978 that the name Attock was adopted for the city.
Attock's first oil well was drilled in Khore in 1946. It has an oil and gas field Dakhini near Jand One-third of Pakistan's oil is produced .Many companies have come to Pakistan and visited different sites to search for oil and gas.