In 1684, Kaohsiung harbor had been significantly improved and became the main distribution center for the Kaohsiung/Pingtung area. In 1858, a decision was taken to develop Kaohsiung harbor as an international commercial port. In 1863, under the Tianjin Treaty, which ended the Second Opium War, the Kaohsiung Customs Authority was formally established, run jointly by the imperial Qing government and Great Britain.