Following the Battle of Grunwald (1410), a number of high-ranking Teutonic prisoners was kept here for ransom. Four sessions of the Sejm (Polish parliament) took place here: in 1420, 1448, 1454 and 1462. In 1420, a Bohemian delegation offered here the Czech crown to Jagiełło. In 1433, the Truce of Łęczyca was signed in the city. Furthermore, the castle served as headquarters of King Casimir IV Jagiellon, during the Thirteen Years' War (1454–66). The city's prominence came to an end with the Swedish invasion of Poland when the castle was overrun and most of the city once again destroyed, and it remained in a state of crisis until the Partitions. One of two main routes connecting Warsaw and Dresden ran through the town in the 18th century and Kings Augustus II the Strong and Augustus III of Poland often traveled that route.