The name Haarlem derives from Haarloheim, meaning a wooded place on high, sandy soil. Its origins date back to the 10th century when the counts of Holland set up a toll post on the Spaarne River. Haarlem quickly became the most important inland port after Amsterdam, but suffered a major setback when the Spanish invaded in 1572. The city surrendered after a seven-month siege but worse was yet to come: upon capitulation virtually the entire population was slaughtered. After the Spanish were finally repelled by Willem van Oranje, Haarlem soared into the prosperity of the Golden Age, attracting painters and artists from throughout Europe.