The 7th century Sojomerto inscription, discovered in neighboring Batang Regency, Central Java, is linked with Kalingga as well as the ancestor of the Sailendras.
The name probably slightly shifted over centuries, from Kalingga, Kaling, Kalong, and later added with pe- -an circumfix forming "Pekalongan".
A book written in 1178 by a Song dynasty official already had a record of Pekalongan, then known to Chinese merchants as "Pukalong".
The people made wine from coconuts, and produced delicious red and white cane sugar.
[5] Pekalongan became a part of the empire of the Sultanate of Mataram through treaties and marriage alliances by the early 17th century.
However, it was a wealthy area, and by the end of the 17th century, the substantial money and produce it sent to the center made it a key part of Mataram's realm.
The Dutch colonial government took advantage of longstanding Javanese expectations that the peasantry contribute a part of their labor to the state.
On October 8, 1945, an anti "Swapraja"/anti feudalism movement called Three Regions Movement/"Gerakan Tiga Daerah" was established in Tegal, Pekalongan, and Brebes.
The goal of this movement was to replace the blue blood regents (related to the kings from Jogyakarta and Surakarta) with ordinary people.
Pekalongan city is divided into four districts, listed below with their areas and their populations as of 2010[2] and 2020[3] Censuses, together with the official estimates as at mid 2023.
[1] The table also includes the number of administrative villages (all classed as urban kelurahan) in each district, and their post codes.