After vast losses of life and property while makeshift solutions were tried—hiding, bargaining, fighting—Europe hit on the answer to invasion: wall-building. Existing towns built walls and prospered by offering security. The lords of the countryside built walls to strengthen their crude castles, thereby enhancing their own importance. Monasteries built walls. Sometimes walls built to protect castle or monastery had the unexpected effect of attracting coopers, blacksmiths, trappers, and peddlers, and so becoming the nuclei of new towns.

