Lahore's origins reach into antiquity. The city has been controlled by numerous empires throughout the course of its history, including the Hindu Shahis, Ghaznavids, Ghurids, and Delhi Sultanate by the medieval era. Lahore reached the height of its splendour under the Mughal Empire between the late 16th and early 18th century, and served as its capital city for a number of years. The city was captured by the forces of Persian Emperor Nader Shah in 1739, and fell into a period of decay while being contested between different powers. Lahore eventually became capital of the Sikh Empire in the early 19th century, and regained much of its lost grandeur. Lahore was then annexed to the British Empire, and made capital of British Punjab. Lahore was central to the independence movements of both India and Pakistan, with the city being the site of both the declaration of Indian Independence, and the resolution calling for the establishment of Pakistan. Lahore experienced some of the worst rioting during the Partition period preceding Pakistan's independence. Following independence in 1947, Lahore was declared capital of Pakistan's Punjab province, and is now the largest Punjabi city in the world.
Lahore exerts a strong cultural influence over Pakistan. Lahore is a major centre for Pakistan's publishing industry, and remains the foremost centre of Pakistan's literary scene. The city is home to the annual Lahore Literary Festival, considered to be one of South Asia's premier cultural events. The city is also a major centre of education in Pakistan, with some of Pakistan's leading universities based in the city. Lahore is also home to Pakistan's film industry, Lollywood, and is a major centre of Qawwali music. The city also hosts much of Pakistan's tourist industry, with major attractions including the famed Walled City, numerous Sikh shrines, and the Badshahi and Wazir Khan mosques. Lahore is also home to the Lahore Fort and Shalimar Gardens, both of which are UNESCO World Heritage Sites.
The origins of Lahore's name are unclear. Lahore's name had been recorded by early Muslim historians as Lōhar, Lōhār, and Rahwar. Al-Biruni referred to the city as Lohāwar in his 11th century work, Qanun, while the poet Amir Khusrow, who lived during the Delhi Sultanate, recorded the city's name as Lāhanūr. Medieval Rajput sources recorded the city's name as Lavkot.
One theory suggests that Lahore’s name is a corruption of the word Ravāwar, as R to L shifts are common in languages derived from Sanskrit. Ravāwar is the simplified pronunciation of the name Iravatyāwar - a name possibly derived from the Ravi River, known as the Iravati River in the Vedas. Another theory suggests the city's name may derive from the word Lohar, meaning "blacksmith."
According to Hindu tradition, Lahore's name derives from Lavpur or Lavapuri ("City of Lava"), and is said to have been founded by Prince Lava, the son of Sita and Rama. The same account attributes the founding of nearby Kasur by his twin brother Prince Kusha, Historic record shows, however, that Kasur was founded by Pashtun migrants in 1525.