According to the Imperial Gazetteer of India, Gujranwala was founded by the Gurjars and renamed Khanpur by the Sherzai tribe of Iran who settled there; however, its old name has survived. Many historians also note that the place was named for the Gurjars who ruled the Gurjara-Pratihara.
In 630, the Chinese Buddhist pilgrim Xuanzang visited a town known as Tse-kia (or Taki), near present-day Gujranwala; a mound near the contemporary village of Asarur has been identified as the site of the ancient city. From the beginning of the 7th century Rajput kingdoms dominated Eastern portions of Pakistan and northern India.
In 997 CE, Sultan Mahmud Ghaznavi, took over the Ghaznavid dynasty empire established by his father, Sultan Sebuktegin, In 1005 he conquered the Shahis in Kabul in 1005, and followed it by the conquests of some western Punjab region. Eastern Regions of Punjab from Multan to the Rawalpindi in north (Including region of present-day Gujranwala) remained under Rajput rule until 1193.
After the decline of the Mughal Empire, the Sikh Empire ruled Gujranwala. The Sikhs dominated the Punjab after the death of Mughal Emperor Aurangzeb Alamgir in 1707. Gujranwala became important during the rule of the father and grandfather of Ranjit Singh, who were born in the city. Ranjit Singh, also born there, became the powerful of the Sikh rulers. Hari Singh Nalwa, military commander of the Sikh army, was credited with building the "new" Gujranwala.
The area was captured by the British Empire in 1848. In 1881, a railway line was built along the Grand Trunk Road to connect Gujranwala with other cities in the Punjab, facilitating trade. The municipality of Gujranwala was created in 1867, and the North-Western Railway connected Gujranwala with other cities in British India, such as Calcutta and Karachi. Gujranwala's population, according to the 1901 Indian census, was 29,224. In 1903 and 1904, income and expenditure were Rs. 83,100 and Rs. 67,900 respectively. The chief source of income was the octroi (Rs. 59,700).
Gujranwala is 226 metres (744 ft) above sea level, sharing borders with Ghakhar Mandi and several towns and villages. About 80 kilometres (50 mi) south is the provincial capital, Lahore. Sialkot and Gujrat lie to its north. Gujrat connects Gujranwala with Bhimber, Mirpure Azad Jammun and Kashmir, and Sialkot connects it with Jammun. About 160 kilometres (99 mi) southwest is Faisalabad. To its west are Hafizabad and Pindi Bhattian, which connect Gujranwala to Jhang, Chiniot and Sargodha.
Gujranwala has a hot semi-arid climate (BSh), according to the Köppen-Geiger system, and changes throughout the year. During summer (June to September), the temperature reaches 36–42 °C (97–108 °F). The coldest months are usually November to February, when the temperature can drop to an average of 7 °C (45 °F). The highest-precipitation months are usually July and August, when the monsoon reaches the Punjab. During the other months, the average rainfall is about 25 millimetres (0.98 in). The driest months are usually November to April, with little rainfall.
According to a GCCI estimate, 5,000 small and medium enterprises and 16,000 cottage units, along with a few large factories, are located in the city.