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 Naval Battle of Hakodate was fought from 4 to 10 May 1869, between the remnants of the Tokugawa shogunate navy and the newly formed Imperial Japanese Navy. It was a decisive victory for the Imperial Japanese Navy.