Narva (Russian: ) is the third largest city in Estonia. It is located at the eastern extreme point of Estonia, by the Russian border, on the Narva River which drains Lake Peipus. People settled in the area from the 5th to 4th millennium BC, as witnessed by the archeological traces of the Narva culture, named after the city. The fortified settlement at Narva Joaoru is the oldest known in Estonia, dated to around 1000 BC. The earliest written reference of Narva is in the First Novgorod Chronicle, which in the year 1172 describes a district in Novgorod called Nerevsky or Narovsky konets (yard). According to historians, this name derives from the name of Narva or Narva River and indicates that a frequently used trade route went through Narva, although there is no evidence of the existence of a trading settlement at the time. The favourable location at the crossing of trade routes and the Narva River was behind the founding of Narva castle and the development of an urban settlement around it. The castle was founded during the Danish rule of northern Estonia during the second half of the 13th century, the earliest written record of the castle is from 1277.Narvia village is mentioned in the Danish Census Book already in 1241. A town developed around the stronghold and in 1345 obtained Lübeck City Rights from Danish king Valdemar IV. The castle and surrounding town of Narva became a possession of the Livonian Order in 1346, after the Danish king sold its lands in Northern Estonia. In 1492 Ivangorod fortress across the Narva River was established by Ivan III of Moscow. Trade, particularly Hanseatic long distance trade remained Narva's raison d'être throughout the Middle Ages. However, due to opposition from Tallinn, Narva itself never became part of the Hanseatic League and also remained a very small town its population in 1530 is estimated at 600750 people.