and subsequently enjoyed support at the court in Moscow. Military Similar to other medieval Russian states, the military of Novgorod consisted of a levy and the prince's retinue (druzhina). While potentially all free Novgorodians could be mobilised, in reality the number of recruits depended on the level of danger faced by Novgorod. The professional formations included the retinues of the archbishop and prominent boyars, as well as the garrisons of fortresses. Firearms were first mentioned in 1394 and in the 15th century fortress artillery was used and cannons were installed on ships. Foreign relations During the era of Kievan Rus', Novgorod was a trade hub at the northern end of both the Volga trade route and the "route from the Varangians to the Greeks" along the Dnieper river system. A vast array of goods were transported along these routes and exchanged with local Novgorod merchants and other traders. The merchants of Gotland retained the Gothic Court trading house well into the 12th century. Later German merchantmen also established tradinghouses in Novgorod. Scandinavian royalty would intermarry with Russian princes and princesses. Hansa, Sweden and Livonian Order After the great schism, Novgorod struggled from the beginning of the 13th century against Swedish, Danish, and German crusaders. During the Swedish–Novgorodian Wars, the Swedes invaded lands where some of the population had earlier paid tribute to Novgorod. The Germans had been trying to conquer the Baltic region since the late 12th century. Novgorod went to war 26 times with Sweden and 11 times with the Livonian Brothers of the Sword. The German knights, along with Danish and Swedish feudal lords, launched a series of uncoordinated attacks in 1240–1242. Novgorodian sources mention that a Swedish army was defeated in the Battle of the Neva in 1240. The Baltic German campaigns ended in failure after the Battle on the Ice in 1242. After the foundation of the castle of Vyborg in 1293 the Swedes gained a foothold in Karelia. On August 12, 1323, Sweden and Novgorod signed the Treaty of Nöteborg, regulating their border for the first time. Mongol invasion and its aftermath The Novgorod Republic was saved from the direct impact of the Mongol invasion as it was the only Rus principality that was never conquered by the Mongol troops. In 1259, Mongol tax-collectors and census-takers arrived in the city, leading to political disturbances and forcing Alexander Nevsky to punish a number of town officials