The former Bakufu retainers leaded by Enomoto Takeaki escaped from Edo in 1868/4 and arrived at Ezo in 1868/10.
After they occupied Goryôkaku fort, they headed to capture Matsumae castle.
In 1868/11/5, the ground troops leaded by Hijikata Toshizo overthrew Matsumae han's defence line at Oyobegawa river. They occupied the hill in front of Matsumae castle.
The castle had 7 batteries.
Everytime when Hijikata's soldiers came close to Karametemon gate, the Matsumae soldiers opened the gate to fire the cannon and closed quickly.
While they were taking the same tactic over and over again, Hijikata took small unit and entered the castle from behind.[1]
Matsumae han surrendered in 1868/11/20.