In the Northern Europe, Konrad of Masovia gave Chelmno to the Teutonic Knights in 1226 as a base for a Crusade against the Old Prussians and Grand Duchy of Lithuania. The Livonian Brothers of the Sword were defeated by the Lithuanians, so in 1237 Gregory IX merged the remainder of the order into the Teutonic Order as the Livonian Order. By the middle of the century, the Teutonic Knights completed their conquest of the Prussians before conquering and converting the Lithuanians in the subsequent decades. The order also came into conflict with the Eastern Orthodox Church of the Pskov and Novgorod Republics. In 1240 the Orthodox Novgorod army defeated the Catholic Swedes in the Battle of the Neva, and, two years later, they defeated the Livonian Order in the Battle on the Ice. The Union of Krewo in 1386, bringing two major changes in the history of the Grand Duchy of Lithuania: conversion to Catholicism and establishment of a dynastic union between the Grand Duchy of Lithuania and the Crown of the Kingdom of Poland marked both the greatest territorial expansion of the Grand Duchy and the defeat of the Teutonic Knights in the Battle of Grunwald in 1410.