In 1863, the Qing Empire opened up Keelung as a trading port and the city enjoyed rapid development due to the abundant commodities such as placer gold and high quality coal found in the drainage area of Keelung River.
During the Sino-French War (1884-85), the French attempted an invasion of Taiwan during the Keelung Campaign.