Novgorod signed a treaty with Casimir IV of Poland-Lithuania and invited him to rule as a prince. The treaty safeguarded the Orthodox church in Novgorod: the posadnik was to be Orthodox and the king was not allowed to build Catholic churches in the Novgorod Land. In spite of this, Ivan III launched his first campaign against Novgorod in 1471 alleging that they converted to Catholicism. After the Novgorodian army was defeated in the Battle of Shelon and the city was besieged, the peace treaty of Korostyn was signed according to which Novgorod acknowledged it as a patrimony of Ivan III, subjected its foreign policy to Moscow, accepted the Grand Prince as the ultimate judicial authority and lost some peripheral lands to the Grand Duchy of Moscow. The Novgorod Land was annexed completely in 1478 and the veche bell was removed to Moscow.