It was first mentioned in the historical documents in 1150 when according to the order of
knyaz Rostislav of Smolensk it was to pay a tax of four
grivnas and a fox skin. The settlement shared the history of the
Smolensk lands—it paid duty to the
Golden Horde, then was captured by the
Grand Duchy of Lithuania and the
Polish–Lithuanian Commonwealth. It was returned to Russia with the rest of the
Smolensk Voivodeship at the close of the
Russo-Polish War of 1654–1667. In 1776, it was granted town status and became the seat of an
uyezd. On 12 July 1929, governorates and uyezds were abolished, and Yelninsky District with the administrative center in Yelnya was established. The district belonged to
Smolensk Okrug of
Western Oblast. On August 1, 1930, the okrugs were abolished, and the districts were subordinated directly to the oblast. On 27 September 1937 Western Oblast was abolished and split between
Oryol and Smolensk Oblasts. Yelninsky District was transferred to Smolensk Oblast. During World War II, Yelnya was a place of several important battles. On 30 August 1941, it became the place of the
Yelnya Offensive, the first successful offensive operation of Soviet troops in the
Great Patriotic War, although they suffered heavy losses taking the town. In 1942, Yelninsky District became a part of the so-called "Dorogobuzh Partisan Krai". The German garrison in the town was not able to control the rural territories which were effectively under the
partisan control. In March 1942, partisans even liberated the town, killing more than a thousand German troops, but in three days on March 18, 1942 they were forced to retreat back to the forests. 289 Jews used to live in Yelnya in 1939 but in March 1942, 230 Jews were shot by German units in a
mass execution. In August 1943, Yelnya played the key part in the
Battle of Smolensk. On August 30, Germans were forced to abandon Yelnya, sustaining heavy casualties. This started a full-scale German retreat from the area. By September 3, Soviet forces reached the eastern shore of the
Dnieper. ==Administrative and municipal status==