In medieval times, after the Livonian Order was subsumed into the Teutonic Knights in 1236, the town became an important trading city. In the 1280s Dorpat joined the Hanseatic League. As in all of Estonia and Latvia, the largely German-speaking nobility, but in Tartu/Dorpat (as in Tallinn) even more so, the Baltic German bourgeoisie, the "literati", dominated culture, religion, architecture, education, and politics until the late 19th century. For example, the town hall of Dorpat was designed by an architect from Rostock in Mecklenburg, while the university buildings were designed by Johann Wilhelm Krause, another German. Many, if not most, of the students, and more than 90 percent of the faculty members were of German descent, and numerous statues of notable scholars with German names can still be found in Tartu today. Most Germans left during the first half of the 20th century, in particular as part of the "Heim ins Reich" program of the Nazis, following the Molotov–Ribbentrop Pact in 1939.