Hakodate was Japan's first city whose port was opened to foreign trade in 1854, as a result of
Convention of Kanagawa, and used to be the most important port in northern Japan. Also, the city had been the biggest city in Hokkaido before the Great Hakodate Fire of 1934.
Hakodate was founded in 1454, when Kono Kaganokami Masamichi constructed a large manor house in the
Ainu fishing village of Usukeshi (the word for bay in Ainu).
After his death, Masamichi's son, Kono Suemichi, and family were driven out of Hakodate into nearby
Kameda during Ainu rebellion in 1512 and little history was recorded for the area during the next 100 years. There was constant low level conflict in the Oshima peninsula at the time with the Ainu as armed merchants like the Kono family established bases to control trade in the region. This conflict culminated in an uprising from 1669 to 1672, led by Ainu warrior
Shakushain after which the Ainu in the region were suppressed.
Hakodate flourished during the
Hoei period (1704–11), and many new temples were founded in the area. The town's fortunes received a further boost in 1741 when the
Matsumae clan, which had been granted nearby areas on the
Oshima Peninsula as a
march fief, moved its Kameda magistracy to Masamichi's house in Hakodate.
In 1779, the
Tokugawa shogunate took direct control over Hakodate, which triggered rapid development in the area. Merchant
Takadaya Kahei, who is honoured as the founder of Hakodate port, set up trading operations, which included opening the northern
Etorofu sea route to the
Kuril island fisheries. He is credited with turning Hakodate from a trading outpost into a thriving city. A Hakodate magistracy was established in 1802.
The port of Hakodate was surveyed by a fleet of five U.S. ships in 1854 under the conditions of the
Convention of Kanagawa, as negotiated by Commodore
Lithograph entitled "View of Hakodate from Snow Peak" looking towards the sea—artist,
Hakodate port partially opened to foreign ships for provisioning in the following year and then completely to foreign trade on 2 June 1859 as one of five Japanese open ports designated in the
1858 Treaty of Amity and Commerce signed with the U.S.
aircraft bombing Hakodate in July 1945
A mariner in Perry's fleet died during a visit to the area and became the first U.S. citizen to be buried in Japan when he was interred in Hakodate's
cemetery for foreigners.
British merchant, naturalist and spy,
Thomas Blakiston, took up residence in Hakodate in the summer of 1861 to establish a saw milling business and in doing so acquainted the city with western culture. He stayed in Hakodate until 1884, during which time he documented the local natural environment, equipped the local meteorological station and ran guns to the
Boshin War rebels.
As one of few points of Japanese contact with the outside world, Hakodate was soon host to several overseas consulates. The Russian consulate included a chapel from where
Nicholas of Japan is credited with introducing
Eastern Orthodox Christianity to Japan in 1861 (now the
Japanese Orthodox Church). The Orthodox church is neighbored by several other historical missionary churches, including
Hakodate also played a central role in the
Boshin War between the
Tokugawa shogunate and the
Meiji Emperor which followed Perry's opening of Japan. Shogunate rebel
Enomoto Takeaki fled to Hakodate with the remnants of his navy and his handful of French advisers in winter 1868, including
Jules Brunet. They formally established the
Republic of Ezo on December 25. The republic tried unsuccessfully to gather international recognition to foreign legations in Hakodate, including the Americans, French, and Russians.
The rebels occupied Hakodate's famous European-style
fort and used it as the centre of their defences in southern Hokkaido. Government forces defeated the secessionists in the
Battle of Hakodate in 1869 and the city and fort were surrendered to emperor. Military leader,
Hijikata Toshizō, was one of those slain in the fighting.
Isabella Bird reported of the city in her travelogue:
The streets are very wide and clean, but the houses are mean and low. The city looks as if it had just recovered from a conflagration. The houses are nothing but tinder… Stones, however, are its prominent feature. Looking down upon it from above you see miles of grey boulders, and realise that every roof in the windy capital is "hodden doun" by a weight of paving stones.
20th century to present day
Hakodate was awarded
city status on August 1, 1922. The city escaped most of the ravages of World War II. Areas around Hakodate-yama were fortified and access restricted to the public. Many prisoners of war were interned in Hakodate and historians record a total of 10 camps.
 The city was subjected to two Allied bombing raids on 14 and 15 July 1945. Around 400 homes were destroyed on the western side of Hakodate-yama and an Aomori-Hakodate ferry was attacked with 400 passengers killed.
In 1976, a defecting
Soviet pilot named
Viktor Belenko flew his plane into the civilian airport in Hakodate.
Hakodate's size nearly doubled on December 1, 2004, when the town of
Kayabe District), and the towns of
Toi, and the village of
Todohokke (all from
Kameda District), were merged into it.