Before "Kōtetsu" was turned over to the Japanese, Tokugawa admiral Enomoto Takeaki refused to surrender his warships after the surrender of Edo Castle to the new government, and escaped to Hakodate in Hokkaido with the remainder of the Tokugawa Navy and a handful of French military advisers and their leader Jules Brunet. His fleet of eight steam warships was the strongest in Japan at the time. On 27 January 1869, Tokugawa loyalists declared the foundation of the Republic of Ezo and elected Enomoto as president. The Meiji government refused to accept partition of Japan and dispatched its newly formed Imperial Japanese Navy, which consisted of "Kōtetsu" as the flagship and a collection of various steam-powered warships that had been contributed by the various feudal domains loyal to the new government. On 25 March 1869, during the Battle of Miyako Bay, "Kōtetsu" successfully repulsed a surprise night attempt at naval boarding by the rebel (spearheaded by survivors from the "Shinsengumi"), making use of a mounted Gatling gun. "Kōtetsu" subsequently supported the invasion of Hokkaidō and various naval engagements in the Naval Battle of Hakodate Bay.