British North Borneo was originally administered from Gaya Island, but the when it burned down, a nearby fishing village was chosen as a replacement, first named Api-Api and then Jesselton after Sir Charles Jessel, a manager of the British North Borneo Company. As the main trading post of the colony, Jesselton dealt in rubber, rattan, honey, and wax, eventually receiving it via a railway built into the interior.
The town was occupied by the Japanese during World War II, but largely destroyed by Allied bombing, with only three buildings left standing. After the war, North Borneo became a British crown colony with a rebuilt Jesselton as the capital superseding Sandakan. The city received its present name in 1968.
Notable locations in KK include the Sabah Foundation Building and the Sabah Museum.