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, the pogost of Vlitsy was founded, which later became a part of Loknya. In the 15th century, the area was annexed by the Grand Duchy of Moscow. In the course of the administrative reform carried out in 1708 by Peter the Great, it was included into Ingermanland Governorate. In 1727, separate Novgorod Governorate was split off, and in 1772, Pskov Governorate was established. The area was a part of Velikoluksky 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 of Loknyanskaya Volost of Velikoluksky Uyezd. The name of the station originates from the nearby Loknya River. 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 of Velikiye Luki Okrug of Leningrad Oblast. On June 17, 1929, the district was transferred to Western 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 to Kalinin 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 the Soviet Union. On May 11, 1937, the district was transferred to Opochka Okrug. On May 4, 1938, the district was subordinated directly to the oblast. Between 1941 and 1944, Loknya was occupied by German troops. On August 22, 1944, the district was transferred to newly established Velikiye 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.
Economy
Industry
Loknya contains enterprises of timber and food industries, the biggest being the bakery.
Transportation
Loknya is a railway station on the railway connecting St. Petersburg and Vitebsk. It is connected by roads with Bezhanitsy, with Kholm, and with Velikiye Luki. There are also local roads.