With the signing of the Potsdam Declaration in 1944 Taiwan was returned to China, and Keelung became a city under the direct jurisdiction of Taiwan province.
光緒年間，台灣建省，首任巡撫劉銘傳在基隆鋪設鐵路，直達新竹，港埠貨物，因此能順著這條血脈進入本島各地。