The coast was known long before the city. Greek writers recorded a place called Krokola, and Alexander the Great stopped there in 326 BCE to ready a fleet. Two older ports, Debal and Bhanbhore, stood nearby until they were abandoned in the 13th century. The remains of a mosque from 727 AD, among the earliest known in the region, are still kept in the city.
Karachi itself began in 1729, when people from the silting-up port of Kharak moved to the mouth of the Hub River. Tradition adds a fisherwoman, Mai Kolachi, who gave the village its name. The settlement grew as other ports silted up, and it got a mud fort with two gates: Khaara-dar, the Salty Gate, facing the sea, and Meetha-dar, the Sweet Gate, facing the Lyari river. Both gates give their names to districts today.
The Talpur rulers of Hyderabad held the town from 1795 until the Bombay Army took it on 2 February 1839. It then had about 15,000 people. The Suez Canal opened in 1869, which put Karachi 200 nautical miles closer to Europe than Bombay. By 1900 it had about 105,000 people.
Pakistan's founder, Muhammad Ali Jinnah, was born here in 1876. You can visit the Kharadar house, Wazir Mansion, where he grew up, and the Flagstaff House on Fatima Jinnah Road, his home for his last four years, until 1948. His marble mausoleum was completed in the 1960s and is now one of the city's landmarks.
Partition in 1947 remade the city. Hundreds of thousands of Muslim refugees arrived from India, and the Hindu share of the population fell from about half to 2 percent by 1951. The newcomers gave Karachi a northern Indian feel. The city served as Pakistan's capital from 1947 to 1958, and then the government moved to Rawalpindi and, in 1960, to the new Islamabad.
Refugees from the Soviet war in Afghanistan arrived in the late 1980s and early 1990s, and tension between the Muhajir community and Sindhis and Punjabis turned violent. The years 1992 to 1994 are remembered as the bloodiest stretch in the city's history. Karachi still handles most of Pakistan's overseas trade.