None of the territory of modern Pakistan was ruled by the British, or other European powers, until 1839, when Karachi, then a small fishing village with a mud fort guarding the harbour, was taken, and held as an enclave with a port and military base for the First Afghan War that soon followed. The rest of Sindh was taken in 1843, and in the following decades, first the East India Company, and then after the post-Sepoy Mutiny (1857–1858) direct rule of Queen Victoria of the British Empire, took over most of the country partly through wars, and also treaties.  The main wars were that against the Baloch Talpur dynasty, ended by the Battle of Miani (1843) in Sindh, the Anglo-Sikh Wars (1845–1849) and the Anglo-Afghan Wars (1839–1919).  By 1893, all modern Pakistan was part of the British Indian Empire, and remained so until independence in 1947.