Pakistan gained independence in 1947 after the end of British colonial rule in the Indian subcontinent. The British had controlled the region comprising present-day India, Pakistan, and Bangladesh since the 18th century under the British East India Company and later directly. After World War II, independence movements weakened British control, and they decided to leave. Many Muslims felt their rights would be compromised in a united India, so they sought a separate homeland, leading to the creation of Pakistan.