In 1227 the Livonian Brothers of the Sword conquered all Danish territories in Northern Estonia. After their defeat in the Battle of Saule, the surviving members of the order merged into the Teutonic Order of Prussia in 1237. On June 7, 1238, the Teutonic Order concluded the Treaty of Stensby at a royal fortress in the south of Zealand with the Danish king, Valdemar II. Under the treaty, Jerwia stayed part of the Ordenstaat, while Harria and Vironia were ceded back to King of Denmark as his direct dominion, the Duchy of Estonia. The first Duke of Estonia had been appointed by Valdemar II in 1220, and the title was now resumed by the kings of Denmark starting in 1269.