Schaffhausen (city) , capital city and commercial center of Schaffhausen Canton in northern Switzerland . Schaffhausen lies 37 km (23 mi) north of the city of Zürich on the north bank of the Rhine River . The city has largely preserved its medieval character and is noted for its narrow streets and the beautiful facades and bay windows of its houses. On a hill above the city rises the historic castle Munot, part of Schaffhausen's old wall and fortification system. The castle in its present form dates from the 16th century. The minster, an early Romanesque basilica, dates from the 11th century. The All Saints Museum was damaged by accidental United States bombing during World War II (1939-1945) but was quickly repaired. Schaffhausen lies on two rail lines. Population (2001) 33,300. Schaffhausen was a city state in the Middle Ages, documented to have struck its own coins starting in 1045. For a time it was under Habsburg domination, but regained its independence in 1415. It allied itself with Zurich in 1457, and became a full member of the Swiss Confederation in 1501. The first railroad came to Schaffhausen in 1857. Schaffhausen is located in a finger of Swiss territory surrounded on three sides by Germany . On April 1, 1944, Schaffhausen suffered a bombing raid by United States Army Air Forces aircraft which strayed from German airspace into neutral Switzerland . While the United States immediately offered a million dollars in reparations, the raid occurred only a month after the Swiss had shot down an American bomber. There were frequent 'accidents' as the war came to a climax, both by bombing raids on towns in northern Switzerland and Allied planes shot down by the Swiss Air Force.