the 10th and 11th centuries. The election of Philip of Swabia in 1198 ended with a homage in Mühlhausen, attended by Walther von der Vogelweide. In 1135, Mühlhausen was first referred to as a villa which can be seen as the beginning of the evolution from a settlement to a city. During the early 12th century, the "old town" was set up around the along the , an important trade route between the Kassel and the Erfurt regions. The fortifications were erected after 1170, eventually including 52 towers. In the early 13th century, the "new town" north of Schwemmnotte river followed with a regular grid around St. Mary's Church and with as main streets. The Teutonic Knights received St. Blaise's Church (Divi-Blasii) in 1227 and St. Mary's Church in 1243 from the emperor, which ensured them influence in the city and high revenues. The largest monastery of Mühlhausen was the 1227-founded at , a Magdalenians monastery. It held large estates in the region and its buildings were demolished in 1884. The Franciscans came to the city in 1225 and built their monastery around today's Corn Market Church and the Dominicans established a monastery in 1289 near ; their church was demolished after a fire in 1689, only some walls remained. Jews have lived in Mühlhausen at least since the late 13th century; the runs parallel to in the new town. During the Black Death Jewish persecutions in 1349, many Mühlhausen Jews were killed. In the mid-13th century, the citizens emancipated more and more from the emperor's rule. For example, Conrad IV had to concede the established wall between the city and the (emperor's court) and later in the 13th century, the citizens destroyed the court. From 1251, Mühlhausen was referred to as a and became the second most powerful city in Thuringia after Erfurt. The "Mühlhausen Law Book" (1224) is the oldest book of law in the German language and regulated the law of the city. In 1308/09, Mühlhausen allied with Erfurt and Nordhausen against the Wettins, who tried to get these three major Thuringian cities under their rule. The alliance lasted nearly 200 years and was successful. After 1348, Mühlhausen did not have to pay any more taxes to the emperor, so that its independence was complete. The three cities pursued their own territorial policy (e.g. by buying castles) to protect their trade routes against robbery, which brought them