The Livonian Order used this period to consolidate their control over Samogitian lands. They built three castles along the border: Memelburg (Klaipėda), Georgenburg (Jurbarkas), and Doben (Durbe in Latvia). The Samogitians responded by electing Algminas as their war leader, and attacked Courland, as the Order had limited battlefield successes. In 1259, the Livonian Order lost the Battle of Skuodas, and in 1260, it lost the Battle of Durbe. The first loss encouraged a rebellion by the Semigalians, and the later loss spurred the Prussians into an uprising against the Order. The Great Prussian Uprising lasted for 14 years. Encouraged by Treniota, his nephew, Mindaugas broke peace with the Order. Some chronicles hint that he also returned to his former pagan beliefs, but this is disputable. Nevertheless, all the diplomatic achievements made since his coronation were lost.