The oldest known mention of Leśnica comes from a 1217 document of Duke Casimir I of Opole. Its name is derived from the Polish word las ("forest").[2] The town was part of the Duchy of Opole of fragmented Poland, and remained ruled by the Piast dynasty until 1532. The town was destroyed in 1429 during the Hussite Wars. In 1532 incorporated into the Bohemian Crown Lands, in 1645 it passed to the Poles again under the House of Vasa, and in 1666 it fell back to Bohemia.
During the Nazi campaign of renaming of placenames, in 1936 while part of the Province of Upper Silesia, it was renamed Bergstadt ("mountain town") to remove traces of Polish origin. In 1945, it became again part of Poland according to the Potsdam Agreement and the historic name Leśnica was restored. Due to fact that no less than 20% of its population belongs to the German minority in Poland,[5] the town uses bilingual Polish and German signs and language – Polish remains official, German is the language of "assistance".[6]