The name Liestal was first mentioned in 1225, and the settlement dates at least from Roman times. The development of the town is due to its strategic location on the road between the first bridge over the Rhine at Basel and the St. Gotthard Pass.
Citizens of Liestal participated in the Burgundian Wars in 1476 and 1477 against Charles the Bold. In 1501, the mayor swore allegiance to the Swiss Confederation, and this caused repeated conflict with neighboring Rheinfelden, which belonged to the Habsburgs.
In the 17th century, Liestal rebelled against Basel as part of the Farmers' Rebellion and was occupied by troops from that city. Three leaders of the rebellion were beheaded in Basel.
In 1789, the town enthusiastically hailed the French call for freedom and equality. It celebrated Napoleon, when he traveled through town in 1797. After his fall, the earlier subjection to Basel was re-established.
The French July Revolution of 1830 also caused upheaval in Liestal. A provisional government was established, and the town was chosen as the capital of a new canton on March 17, 1832.