Order to connect their monastic state with the borders of the Holy Roman Empire. Crusading reinforcements and supplies could travel from the Imperial territory of Hither Pomerania through Pomerelia to Prussia, while Poland's access to the Baltic Sea was blocked. While Poland had mostly been an ally of the knights against the pagan Prussians and Lithuanians, the capture of Pomerelia turned the kingdom into a determined enemy of the Order. The capture of Gdańsk marked a new phase in the history of the Teutonic Knights. The persecution and abolition of the powerful Knights Templar, which began in 1307, worried the Teutonic Knights, but control of Pomerelia allowed them to move their headquarters in 1309 from Venice to Marienburg (Malbork) on the Nogat River, outside the reach of secular powers. The position of Prussian Landmeister was merged with that of the Grand Master. The Pope began investigating misconduct by the knights, but no charges were found to have substance. Along with the campaigns against the Lithuanians, the knights faced a vengeful Poland and legal threats from the Papacy. The Treaty of Kalisz of 1343 ended the open war between the Teutonic Knights and Poland. The Knights relinquished Kuyavia and Dobrzyń Land to Poland, but retained Chełmno Land and Pomerelia with Gdańsk (Germanized as Danzig). Battle of Legnica In 1236, the Knights of Saint Thomas, an English order, adopted the rules of the Teutonic Order. A contingent of Teutonic Knights of indeterminate number is traditionally believed to have participated at the Battle of Legnica in 1241 during the first Mongol invasion of Poland. The combined Polish-German army was crushed by the Mongol army and their superior tactics, with few survivors. Height of power In 1337, Emperor Louis IV allegedly granted the Order the imperial privilege to conquer all Lithuania and Russia. During the reign of Grand Master Winrich von Kniprode (1351–1382), the Order reached the peak of its international prestige and hosted numerous European crusaders and nobility. King Albert of Sweden ceded Gotland to the Order as a pledge (similar to a fiefdom), with the understanding that they would eliminate the pirating Victual Brothers from this strategic island base in the Baltic Sea. An invasion force under Grand Master Konrad von Jungingen conquered the island in 1398 and drove the Victual Brothers out of Gotland and the Baltic Sea. In 1386, Grand Duke Jogaila of Lithuania was baptised into Christianity and married