By the end of the Saxon period, Wareham had become one of the most important towns in the county, to the extent that it housed two mints for the issue of Royal money. The Burghal Hidage lists the town as 1,600 hides, the third largest in the realm. During the Norman conquest of England, in late 1067, William I harried the town as his army passed into the west to lay siege to Exeter. The Normans later built a castle on the banks of the River Frome, at a site acquired from the Abbot of Shaftesbury and now known as Castle Close, which became the focus of much fighting between the forces of Stephen and Matilda during the period of civil war in the mid 12th century. The keep was destroyed at an unknown date in the 12th or 13th century, possibly under the terms of the Treaty of Wallingford, and no visible trace remains. Up until this time Wareham had been an important port; however the growth of Poole and the gradual silting of the river caused a decline in trade and by the end of the 13th century most of the foreign trade had transferred to Poole. Local trade continued to be handled at the Quay until the construction of the railway in the 19th century.