Gryfice (pronounced AUDPl-Gryfice.ogggry'fJice; Kashubian: Grëfice; is a historic town in Pomerania, north-western Poland, with 16,600 inhabitants (2017). It is the capital of Gryfice County in West Pomeranian Voivodeship (since 1999), previously in Szczecin Voivodeship (1975–1998). The town is situated approximately 22 kilometres from the Baltic Sea coast and seaside resorts. The region was part of Poland during the reign of the first Polish rulers Mieszko I and Bolesław I the Brave. The Battle of Niekładź took place in the area of Gryfice in 1121, in which Polish ruler Bolesław III Wrymouth defeated Wartislaw I, Duke of Pomerania and Swantopolk I, Duke of Pomerania. The area was part of the Duchy of Pomerania, a vassal state of Poland, which later on separated itself from Poland as a result of the fragmentation of Poland. In 1262 Wartislaw III, Duke of Pomerania founded a town under Lübeck law on the Rega river to attract German settlers. After his death, his successor, Barnim I, Duke of Pomerania, named the settlement Civitat Griphemberch super Regam (Middle High German 'Griphemberch' meaning Griffin's mountain) after the coat of arms symbol of the Dukes of Pomerania. In 1365 the town entered the Hanseatic League and prospered due to the right of free navigation on the Rega. A town wall was built and at the end of the 13th century the construction of the St. Mary's church was begun. In a document of 1386 a Latin school is mentioned, which is generally called the oldest in Pomerania. In the 16th century, the local Germans pursued a policy of Germanisation towards the indigenous population, which, however, did not bring results quickly. At that time, some of the indigenous peasants fled to Poland, while Scottish immigrants settled in the town. As a result of the Thirty Years' War, the population of the town decreased dramatically. The town was occupied by the Imperial and Swedish armies. After the death of the last Pomeranian Duke and by the Treaty of Westphalia Greifenberg became part of Brandenburg-Prussia in 1648 and part of Imperial Germany in 1871.