The settlements were centred around the stronghold on Old Town Hill, which was likely one of the main centres of Lendians tribe. When the tribal stronghold was destroyed in the 10th century, the centre shifted to the northeast, to a new stronghold above Czechówka valley and, after the mid-12th century, to Castle Hill. At least two churches are presumed to have existed in Lublin in the early medieval period. One of them was most probably erected on Czwartek Hill during the rule of Casimir the Restorer in the 11th century. The castle became the seat of a castellan, first mentioned in historical sources from 1224, but was quite possibly present from the start of the 12th or even 10th century. The oldest historical document mentioning Lublin dates from 1198, so the name must have come into general use some time earlier. The location of Lublin at the eastern borders of the Polish lands gave it military significance. During the first half of the 13th century, Lublin was a target of attacks by Mongols, Tatars, Ruthenians, and Lithuanians, which resulted in its destruction. It was also ruled by Kingdom of Galicia–Volhynia between 1289 and 1302. Lublin was founded as a town by Władysław I the Elbow-high or between 1258 and 1279 during the rule of the prince Bolesław V the Chaste. Casimir III the Great, appreciating the site's strategic importance, built a masonry castle in 1341 and encircled the city with defensive walls. From 1326, if not earlier, the stronghold on Castle Hill included a chapel in honor of the Holy Trinity. A stone church dating to 1335–1370 exists to this day. Jagiellonian Poland In 1392, the city received an important trade privilege from the king Władysław II Jagiełło. With the coming of peace between Poland and Lithuania, it developed into a trade centre, handling a large portion of commerce between the countries. In 1474, the area around Lublin was carved out of Sandomierz Voivodeship and combined to form the Lublin Voivodeship, the third voivodeship of Lesser Poland. During the 15th and 16th centuries, the town grew rapidly. The largest trade fairs of the Polish–Lithuanian Commonwealth were held in Lublin. In the 16th century, the parliaments (Sejm) of the Kingdom of Poland were held in Lublin several times. On 26 June 1569, one of the most important proclaimed the Union of Lublin, which united Poland and Lithuania. Lublin as one of