Coordinates 51°14'N, 22°34'EThe first permanent settlements on the Lublin site were established in the early Middle Ages, though archeological finds indicate a long, earlier presence of various cultures in the general area. The earliest, most significant settlement began in the 6th century, on a hill located in the suburb of Czwartek (in Polish Thursday, most likely in reference to the market day of the settlement). It is likely that the surrounding hills, notably the site of the present day Old Town, were also settled at around this time. In the 10th and 11th centuries the Czwartek settlement developed into an important trade centre. The location of Lublin at the eastern borders of the Polish lands gave it a military significance. The first fortification on the site may have been built as early as the 8th century, possibly on the Castle Hill. Certainly at the end of the 10th century a significant fortification existed there. As the castle grew, the Old Town hill adjacent to it became the main focus of settlement, and the Czwartek settlement declined in relative importance. The castle became the seat of a Castellan, first mentioned in historical sources from 1224, but 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 city was a target of attacks by Tatars, Ruthenes, Yotvingians and Lithuanians and was destroyed a number of times. It received a city charter in 1317. Casimir the Great, appreciating the strategic importance of the site, built a masonry castle in 1341 and encircled the city with defensive walls.
In 1392, the city received an important trade privilege from king Wladyslaw Jagiello, and with the coming of the peace between Poland and Lithuania developed into a great trade centre carrying a large portion of commerce between the two countries. In 1474 the area around Lublin was combined to form the Lublin Voivodeship. In the 15th century and 16th century the town grew rapidly. The largest trade fairs of the Polish-Lithuanian Commonwealth were held in Lublin. During the 16th century the noble parliaments (sejm) were held in Lublin a number of times. On June 26, 1569, one of the most important ones proclaimed the Union of Lublin, which united Poland and Lithuania. The Lithuanian name for the city is Liublinas.