During the early years of Grand Duchy of Lithuania piliakalniai played a major role in conflicts with the Livonian Order and the Teutonic Knights. During this period the number of piliakalniai in use decreased, but those that remained had stronger fortifications. Two main defence lines developed: one along the Neman River (against the Teutonic Order) and another along the border with Livonia.