Dorpat (mod. Tartu, Estonia) was the third largest town of Livonia and a bishopric in the Middle Ages. After the final capture of the Estonian hill fort there in 1224 by the crusaders, Dorpat developed into an important center, becoming the seat of a bishopric covering all of southern Estonia. Its western half was subject to the secular rule of the Order of the Sword Brethren, and later of the Teutonic Order. The ambitions of the latter were consistently opposed by the bishops.
The town beside the castle is first mentioned in connection with an attack by the Russians of Novgorod in 1262. Soon after that, the settlement received its first stone fortifications. Because of its location on the waterway to Pskov, Dorpat developed into a large commercial center and joined the Hanseatic League. At the beginning of the fifteenth century, Dorpat, together with Riga and Reval (mod. Tallinn, Estonia), gained control over the eastern trade, and Dorpat contained a Russian quarter with its own Russian settlement and church.
At the beginning of the Livonian War, in 1558, the town surrendered to Muscovite forces. The effects of warfare depleted the wealth of the town, which could not be restored during the following centuries of Polish and Swedish overlordship.