After a series of Polish-Teutonic Wars, in the Treaty of Kalisz (1343) the Order had to acknowledge that it would hold Pomerelia as a fief from the Polish Crown. Although it left the legal basis of the Order's possession of the province in some doubt, the city thrived as a result of increased exports of grain (especially wheat), timber, potash, tar, and other goods of forestry from Prussia and Poland via the Vistula River trading routes, although after its capture, the Teutonic Knights tried to actively reduce the economic significance of the town. While under the control of the Teutonic Order German migration increased. The Order's religious networks helped to develop Danzig's literary culture. A new war broke out in 1409, culminating in the Battle of Grunwald (1410), and the city came under the control of the Kingdom of Poland. A year later, with the First Peace of Thorn, it returned to the Teutonic Order.