Most of the town is within the boundaries of the historic county of Cheshire, with the area north of the Mersey in the historic county of Lancashire. Stockport in the 16th century was a small town entirely on the south bank of the Mersey, known for the cultivation of hemp and manufacture of rope. In the 18th century, it had one of the first mechanised silk factories in the British Isles. Stockport's predominant industries of the 19th century were the cotton and allied industries. It was also at the centre of the country's hatting industry, which by 1884 was exporting more than six million hats a year; the last hat works in Stockport closed in 1997.