The friendly relations between Janusz I and Władysław II Jagiełło caused a permanent state of hostility between Masovia from the Teutonic Order. In 1393, and for unknown reasons, Janusz I was captured during a visit to the border castle in Złotoryja near Narew by the komturs of Balga and Ragnit and imprisoned at Malbork Castle by orders of the Grand Master, Konrad von Jungingen. Probably with this actions they wanted to provoke the Polish for war with the Order. As a result of the intervention of Władysław II Jagiełło, who sent deputies to the Teutonic Knights, Janusz I was released. In 1404 the Knights again captured Janusz I, this time with his wife and sons, and kept them in Saxony. Again, only the intervention of the Polish King could released them.