The area was populated since medieval times and was located on the waterways which connected Novgorod and Pskov with Velikiye Luki. In the 15th century, thepogost ofVlitsy was founded, which later became a part of Loknya. In the 15th century, the area was annexed by theGrand Duchy of Moscow.[3]In the course of theadministrative reform carried out in 1708 byPeter the Great, it was included into Ingermanland Governorate (known since 1710 asSaint Petersburg Governorate). In 1727, separateNovgorod Governorate was split off, and in 1772,Pskov Governorate (which between 1777 and 1796 existed asPskov Viceroyalty) was established. The area was a part ofVelikoluksky Uyezd of Pskov Governorate.
Loknya was founded in 1900 as a settlement serving the railway station on the railway between Moscow and Riga. Eventually, it became the administrative center ofLoknyanskaya Volost of Velikoluksky Uyezd. The name of the station originates from the nearbyLoknya River.[3]
On August 1, 1927, the uyezds were abolished, and Loknyansky District was established, with the administrative center in Loknya. The governorates were abolished as well, and the district became a part ofVelikiye Luki Okrug ofLeningrad Oblast. On June 17, 1929, the district was transferred toWestern Oblast. On July 23, 1930, the okrugs were also abolished and the districts were directly subordinated to the oblast. On January 29, 1935, Western Oblast was abolished, and the district was transferred toKalinin Oblast, and on February 5 of the same year, Loknyansky District became a part of Velikiye Luki Okrug of Kalinin Oblast, one of the okrugs abutting the state boundaries of theSoviet Union. On May 11, 1937, the district was transferred toOpochka Okrug. On May 4, 1938, the district was subordinated directly to the oblast. Between 1941 and 1944, Loknya was occupied byGerman troops.Executions of the local Jews took place in February 1942.[10] On August 22, 1944, the district was transferred to newly establishedVelikiye Luki Oblast. On October 2, 1957, Velikiye Luki Oblast was abolished and Loknyansky District was transferred to Pskov Oblast. The district was abolished on February 1, 1963, and re-established on January 12, 1965.[11]
Loknya has one building, the Transfiguration Church of the beginning of the 18th century, which is classified as cultural and historical heritage of local significance.[13]
Псковское областное Собрание депутатов. Закон №833-оз от 5 февраля 2009 г. «Об административно-территориальном устройстве Псковской области». Вступил в силу со дня официального опубликования. Опубликован: "Псковская правда", №20, 10 февраля 2009 г. (Pskov Oblast Council of Deputies. Law #833-oz of February 5, 2009On the Administrative-Territorial Structure of Pskov Oblast. Effective as of the official publication date.).
Псковское областное Собрание депутатов. Закон №420-оз от 28 февраля 2005 г. «Об установлении границ и статусе вновь образуемых муниципальных образований на территории Псковской области», в ред. Закона №1542-ОЗ от 5 июня 2015 г. «О внесении изменений в Закон Псковской области "Об установлении границ и статусе вновь образуемых муниципальных образований на территории Псковской области"». Вступил в силу со дня официального опубликования. Опубликован: "Псковская правда", №41–43, №44–46, №49–51, 4 марта 2005 г., 5 марта 2005 г., 11 марта 2005 г. (Pskov Oblast Council of Deputies. Law #420-oz of February 28, 2005On Establishing the Borders and the Status of the Newly Formed Municipal Formations on the Territory of Pskov Oblast, as amended by the Law #1542-OZ of June 5, 2015On Amending the Law of Pskov Oblast "On Establishing the Borders and the Status of the Newly Formed Municipal Formations on the Territory of Pskov Oblast". Effective as of the official publication date.).