The area of Dhaka has been inhabited since the first millennium. The city rose to prominence in the 17th century as a provincial capital and commercial center of the Mughal Empire in South Asia. Dhaka was the capital of Mughal Bengal for 75 years. As the center of the muslin trade in Bengal, it was one of the most prosperous cities in the Indian subcontinent. The medieval city was named Jahangirabad in honor of the Mughal Emperor Jahangir and hosted the seat of the Mughal Subahdar (governor), Naib Nazims and Dewans (prime ministers). Medieval Dhaka's glory peaked in the 17th and 18th centuries, when it was home to merchants from across Eurasia. The Mughals decorated the city with well-laid out gardens, tombs, mosques, palaces and forts. The city was once called the Venice of the East. Under the British Empire, the city saw the introduction of electricity, railways, cinemas, Western-style universities and colleges and a modern water supply. It became an important administrative and educational center in Eastern Bengal and Assam after 1905. In 1947, after ending of British rule, it became the administrative capital of East Pakistan. It was declared as the legislative capital of Pakistan in 1962. In 1971, it became the capital of an independent Bangladesh. Article 5 of the Constitution of Bangladesh declares Dhaka as the capital of the republic.
The origins of the name for Dhaka are uncertain. Once dhak trees were very common in the area and the name may have originated from it. Alternatively, this name may refer to the hidden goddessDhakeshwari, whose temple is located in the south-western part of the city. Another popular theory states that Dhaka refers to a membranophone instrument, dhak which was played by order of SubahdarIslam Khan I during the inaugurating of the Bengal capital in 1610.
Some references also say it was derived from a Prakrit dialect called Dhaka Bhasa; or Dhakka, used in the Rajtarangini for a watch-station; or it is the same as Davaka, mentioned in the Allahabad pillar inscription of Samudragupta as an eastern frontier kingdom. According to Rajatarangini written by a Kashmiri Brahman, Kalhana, the region was originally known as Dhakka. The word Dhakka means watchtower. Bikrampur and Sonargaon—the earlier strongholds of Bengal rulers were situated nearby. So Dhaka was most likely used as the watchtower for the fortification purpose.