As of 2020, the city had a population of 52,952. It is next to, but independent of, Lankaran District. The city forms a distinct first-order division of Azerbaijan.
However, some sources state that Lankaran is said to come from the Talish words for 'Cane house', which sounds as 'Lan Karan'. Alternatively, from Median *Lan(a)karan-, where *karan- means 'border, region, land' and Lan is probably a name of a Caspian tribe.
The city was built on a swamp along the northern bank of the river bearing the city's name. There are remains of human settlements in the area dating back to the Neolithic period as well as ruins of fortified villages from the Bronze and Iron Ages.
With the death of Nader Shah (r. 1736-1747), the Talysh Khanate was founded by a certain Seyyed Abbas, whose ancestors were members of the Iranian Safavid dynasty, and had moved into the Talish region during the 1720s during a turbulent period in Iranian history. From the founding of the khanate, until 1828, it was under the suzerainty of the Iranian Zand and Qajar dynasties. In the first half of the 18th century, the Russians gained control over it for a few years through the Russo-Persian War of 1722-1723; in 1732 it was ceded back to Iran by the Treaty of Resht. During the Russo-Persian War of 1804-1813, General Kotlyarevsky heading the southernmost Russian contingent during the war, stormed and captured Lankaran's fortress. Following the Treaty of Gulistan of 1813, it was ceded to Russia. Qajar Iran would later retake the city during the Russo-Persian War of 1826-1828, but was forced to return it following the Treaty of Turkmenchay (1828), which saw the definite end of Persian influence in the South Caucasus.
As of 2012, the city along with Baku and Ganja participated in Earth Hour movement. Lankaran's cuisine has largely been affected by its multicultural history, hence the large variety of food originating during Talysh Khanate. Lankaran's signature cuisine includes lavangi, Lankaran kulcha, marji plov, white plov, pumpkin plov and turshu kebab. The city has one professional football team competing in the top-flight of Azerbaijani football - Khazar Lankaran, currently playing in the Azerbaijan Premier League. Sporting venues in the city include the Lankaran City Stadium and Lankaran Olympic Sports Complex. The stadium was one of the venues for the group stages of the 2012 FIFA U-17 Women's World Cup.
In 2012, the city won to host European Masters Weightlifting Championship.