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 peninsular 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 the 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.
A mariner in Perry's fleet died during a visit to the area and became the first US 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 Anglican and Catholic.
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 1866, 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 Goryokaku fort and used it as the centre of their defences in southern Hokkaidō. Government forces defeated the secessionists in the Battle of Hakodate in 1869 and the city and fort were surrendered to emperor. Military leader, Hijikata Toshizo, was one of those slain in the fighting.
In 1878, 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.
Hakodate is located in the centre of Kameda peninsula.
The city is overlooked by , a lumpy, forested mountain whose summit can be reached by hiking trail, cable car, or car. The night view from the summit is renowned in Japan as one of the best in the country. An obscure local nickname of the bumpy mountain is Gagyuzan (Mount Cow's Back), alluding to the way the mountain resembles a resting cow.
The former Goryukaku fort is now used in as a public park and is popular in Hokkaidō for hanami (cherry blossom viewing). Since April 2006, the park has also featured the tall, white Goryokaku Tower. Resembling an air traffic control tower, the structure offers a panoramic view of the park, including mainland Japan across the Tsugaru Strait on clear days.
Hakodate Airport is located in Hakodate.