After a crushing defeat of the Teutonic Knights in the Battle of Durbe in 1260, the Prussians rebelled again. The Great Prussian Uprising lasted for fourteen years. Warmians appointed Glappo as their leader and joined the uprising. During the early stage of the uprising, Glappo and his men successfully captured Braunsberg, but failed to capture Balga. In 1266, the rulers of Brandenburg arrived in Prussia and built a castle on the border of Warmian and Natangian lands between Balga and Königsberg. Named Brandenburg (now Ushakovo), the castle withstood Prussian attacks. Glappo was captured and hanged when he tried to recapture the fortress in 1273. The uprising ended a year later, and it was the last time the Warmians rebelled. Afterwards they were slowly assimilated by the Germans and Poles. Poles settled in greater numbers after the Second Peace of Thorn (1466), and removed the Prince-Bishopric of Warmia from the control of the Teutonic Knights and placed it under the sovereignty of the Crown of Poland as part of the province of Royal Prussia.