Between Lautrach near Memmingen and Ulm it forms the border between the two German States Bavaria and Baden-Württemberg for about 50 kilometres (31 mi). The river flows into the Danube in the city centre of Ulm.