Gujrat is a place of some antiquity and abounds in important ancient sites. The city and district formed part of the kingdom of
Porus who ruled primarily within the
Chaj Doab. He was defeated by
Alexander after a difficult campaign at the
Battle of Hydaspes in May 326 BC. With Alexander's death in June 323 BC,
Chandragupta Maurya (referred to in Greek sources as "Sandrokottos") who was from Magadha region (present-day Bihar in India)
Mauryan Empire. The name Alakhana etymologically is in reference to the Alchon Huns. This may be the Ali Khan whom the present
Gujjar tribe in Gujrat hail as their elder and founder of Gujrat. The area was named Khwaspur
, The city came under the
Mughal Empire and was further developed during the reign of
Akbar in the latter half of the 16th century, who built the
Gujrat Fort, and allowed Gujjars to settle in the fort who had been living within the district for centuries up to this time. The city and district was formally named in reference to the local Gujjar tribe. In the Mughal era, Gujrat was encircled by a wall with five gates, of which only the Shah Daula gate survives. , and was built during the British era. With the death of
Aurangzeb, in 1707, the Mughal Empire began to weaken significantly. Mughal authority in Punjab remained in the hands of Mughal Nawabs, despite the
Afsharid ruler
Nader Shah leading an
invasion in 1739 that resulted in the sacking of the capital Delhi. Mughal rule effectively collapsed in
Punjab after
Mir Mannu died in 1753. The
Durrani Afghans under their new ruler
Ahmad Shah Durrani annexed the region directly from the Mughals. The city suffered further from the eight invasions of the Durrani Afghans between 1748 and 1767 who fought the
Sikhs for control of Punjab. The Sikhs defeated an Afghan force in a battle for Gujrat on 29 April 1797. In 1798, the Bhangi leader Sahib Singh pledged allegiance to the Sukerchakia Misl of
Ranjit Singh who later established the
Sikh Empire in 1799. By 1810, Ranjit Singh's armies captured the city from Bhangi forces, thereby extending the rule of the Sikh Empire to the city. Gujrat finally came under British control in 1849, following the collapse of the Sikh Empire in the wake of the Sikh defeat at the
Battle of Gujrat on 22 February, which ended the
Second Anglo-Sikh War. In 1867, Gujrat was constituted as a municipality. According to the census, the city had a population of 18,396 in 1881, 19,410 in 1901 and 21,974 in 1921. ==Geography==