The names found in ancient sources for Swat are Udyana and Suvastu because of the scenic beauty of the valley and the name of the river respectively. Swat has been inhabited for over two thousand years. The first inhabitants were settled in well-planned towns. In 327 BC, Alexander the Great fought his way to Udegram and Barikot and stormed their battlements. In Greek accounts these towns have been identified as Ora and Bazira. Around the 2nd century BC, the area was occupied by Buddhists, who were attracted by the peace and serenity of the land. There are many remains that testify to their skills as sculptors and architects. In the beginning of the 11th century AD, Mahmud of Ghazni advanced through Dir and invaded Swat, defeating Gira, the local ruler, near Udegram. Later the land was taken over by the Dilazak, who in turn were ousted by the Yusufzais. The originator of the present family of Swat was the Muslim saint Abdul Ghafoor, a Safi Momand of Hazara district, from where he went to Buner territory. He was a pious man and the people respected him so greatly that they called him AKHUND SAHIB.
It was the mid-19th century when Muslim tribes were fighting against each other for the possession of Swat Valley. On the intervention of the honourable Akhund Sahib, the killing was stopped, and such was his influence that the chiefs of all tribes unanimously made him the ruler of the valley. Akhund Sahib administrated the valley according to Muslim laws. Peace and tranquility prevailed, and agriculture and trade flourished in the territory. Akhund Sahib had two sons by his wife, who belonged to Nikbi Khel.
After the death of Akhund Sahib, the tribal chiefs again started fighting and killing, which continued for years. Eventually the tribal chiefs agreed to give the control of the valley into the hands of the honourable Gul Shahzada Abdul Wadood, the son of Mian Gul Abdul Khaliq, son of Akhund Sahib. The wife of Mian Abdul Wadood was the daughter of Honorable Mirza Afzal-ul-Mulk, the ruler of Chitral. The British by trick put Chitral under the suzerainty of Kashmir. The Chitral ruler gave two horses every year to the Rajia of Kashmir, and the Raja provided Chitral with grain and sugar, etc. Swat thus went under protection of the British.
During the rule of Mian Gul Muhammad, Abdul Haq Jehanzeb, the son of Mian Abdul Wadood, the state acceded to Pakistan in 1947. The present prince, Muhammad Aurzngzeb Khan, son of Jahanzeb, married the daughter of Field Marshal Mohammad Ayub Khan in 1955. Thus by intermarriages with the other castes, the family became a branch of the imperial Gujjars i-e the Royal family of swat wali is belong to the Gurjar Rajput family witch laid down the foundation of swat kingdom. Jahznzeb started a Degree College at Saidu Sahrif, the capital of the State, and four High Schools at Mingora, Chakesar, Matta and Dagar. Fourteen middle schools, twenty-eight lower middle schools, and fifty-six primary schools were established. A girls high school and high class religious schools were established at Saidu Sharif. At all the schools, the poor students were granted scholarships. The state was an exemplary state during British rule. The Gujjars were very poor people in the Swat Valley, but nowadays they have diverted their attention towards education and are holding good posts in government services. They also have a firm stand in politics of Pakistan. The current Prince Aurangzeb Khan was also Governor of Baluchistan.