The major problem that Ivan III faced in the process of association of Russian lands was annexation of vast territories of Veliky Novgorod. The Great Lithuanian Princedom also laid claims to those territories. The Novgorod nobility, being under constant pressure of two opposing mighty powers - Moscow and Lithuania, understood that independence of Novgorod might be preserved only by entering into an alliance with one of them. The Moscow party was basically made up by ordinary Novgorod people who saw in the Grand Duke of Moscow first of all an orthodox sovereign. The Lithuanian party was supported by absolute majority of boyards and "best people" who aspired to preserve their traditional privileges.
In 1471 Novgorod authorities concluded a treaty with Lithuania. Kazimir IV Yagailovich, the King of Poland and Lithuania, guaranteed protection from Moscow and promised to send his deputy to Novgorod. The initiator of this treaty was a widow of the head of Novgorod and the actual leader of local nobility Marpha Boretskaya. In May, 1471, having learned about this treaty, Ivan III made the decision to campaign against the independent city.
The war with Novgorod was represented as a campaign for orthodox religion, against turncoats. The Moscow army was led by Prince Daniel Holmsky. Kazimir IV did not dare to levy war against Moscow and the promised assistance was not rendered. Avant-guard of the Moscow army burnt the city of Rusu and crushed advanced Novgorod troops near Ilmen Lake. A decisive battle took place on July 14, 1471 at the bank of the Shelon River. The Moscow troops utterly defeated the Novgorod home guard.
The way to Novgorod laid open. The Novgorod authorities understood hopelessness of their position and surrendered at discretion. The Grand Duke of Moscow forgave the apostates and obliged them to pay huge redemption - 15,5 thousand roubles (note that the price of several country homesteads of that time was 2 - 3 roubles at the most). Since then Novgorod became a patrimony of Ivan III.
The Novgorod authorities broke off any diplomatic relations with Lithuania. Distempers however went on. Then on November 23, 1475 Ivan III came to Novgorod with a big retinue, playing a role of a fair judge protecting the offended. Some Novgorod boyards were arrested. In 1477 Novgorod ambassadors recognized Ivan III their sovereign what meant unconditional submission of Novgorod to the power of Moscow.
The Grand Duke demanded a direct control of Novgorod and liquidation of its independence. First, Novgorod people refused to submit. But in January of 1478 Ivan III besieged the city, and soon its inhabitants had to capitulate. The Veche Bell was removed from Veliky Novgorod to Moscow, the local authorities were liquidated and from that moment on the city was governed by Moscow deputies. In 1484 - 1499 the lands of the Novgorod boyards were confiscated and land owners themselves were resettled in the central regions of Muscovy. The Novgorod Republic ceased to exist.
Pskov still preserved self-management, but it was also under a tight control of the Grand Duke of Moscow.