In pre-Han times (i.e., before 206 BC), the site of the city of Shiyi in the state of Zhao was located in this area, and from Han (206 BC–AD 220) to Sui (581–618) times it was the site of a county seat with the same name. With the reorganization of local government in the early period of the Tang dynasty (618–907), the county was abolished. The name "Shijiazhuang" was first mentioned in 1535 on a stele of a local temple. Shijiazhuang was then little more than a local market town, subordinated to the flourishing city of Zhengding a few miles to the north.
The growth of Shijiazhuang into one of China's major cities began in 1905, when the Beijing–Wuhan (Hankou) railway reached the area, stimulating trade and encouraging local farmers to grow cash crops. Two years later the town became the junction for the new Shitai line, running from Shijiazhuang to Taiyuan, Shanxi. The connection transformed the town from a local collecting centre and market into a communications centre of national importance on the main route from Beijing and Tianjin to Shanxi, and later, when the railway from Taiyuan was extended to the southwest, to Shaanxi as well. The city also became the centre of an extensive road network.
Pre-World War II Shijiazhuang was a large railway town as well as a commercial and collecting centre for Shanxi and regions farther west and for agricultural produce of the North China Plain, particularly grain, tobacco, and cotton. By 1935 it had far outstripped Zhengding as an economic centre. At the end of World War II the character of the city changed when it took on an administrative role as the preeminent city in western Hebei, and developed into an industrial city. Some industries, such as match manufacturing, tobacco processing, and glassmaking, had already been established before the war.
On November 12, 1947, the city was captured by Communist forces. In 1948 the city, formerly known as Shímén (石門), was renamed Shijiazhuang.
Xibaipo, a village about 90 km (56 mi) from downtown Shijiazhuang, in Pingshan County was the location of the Central Committee of the Communist Party of China and the headquarters of the People's Liberation Army during the decisive stages of the Chinese Civil War between May 26, 1948 and March 23, 1949, at which point they were moved to Beijing. Today, the area is a memorial site.
After 1949 the industrialisation of the city gathered momentum. Its population more than tripled in the decade 1948–58. In the 1950s, the city experienced a major expansion in the textile industry, with large-scale cotton spinning, weaving, printing, and dyeing works. In addition there are plants processing local farm produce. In the 1960s it was the site of a new chemical industry, with plants producing fertilizer and caustic soda. Shijiazhuang also became an engineering base, with a tractor-accessory plant. There are important coal deposits at Jingxing and Huailu, now named Luquan, a few miles to the west in the foothills of the Taihang Mountains, which provide fuel for a thermal-generating plant supplying power to local industries.
In 1967, Tianjin was again carved out of Hebei, remaining a separate entity today, and thus the provincial capital was moved to Baoding. It was chaotic in the midst of the Cultural Revolution, and under the direction of Mao Zedong, in 1968, to "prepare for war and natural disasters", Shijiazhuang became the provincial capital.