The city was an Ainu habitation, and the name "Otaru" is recognised as being of Ainu origin, possibly meaning "River running through the sandy beach". The very small remaining part of the Temiya Cave contains carvings from the Zoku-J?mon period of Ainu history, around A.D. 400. Otaru was recognised as a village by the bakufu in 1865, and in 1880 the first railway line in Hokkaido was opened with daily service between Otaru and Sapporo.
The city flourished well as the financial and business center in Hokkaido as well as the trade port with Japanese ruled southern Sakhalin until 1920s. Otaru was redesignated as a city on August 1, 1922.
On December 26, 1924, a freight train loaded with 600 cases of dynamite exploded in Temiya Station, damaging the warehouse, the harbour facilities and the surrounding area. Local officials stated that at least 94 were killed and 200 injured in this disaster.
Since 1950s, as the coal industry around the city went into a decline, the status of economic hub shifted from Otaru to Sapporo