 Traveling to Hokkaidō, he became Navy Minister of the new Republic of Ezo, and while he took part in the Naval Battle of Miyako Bay and the Naval Battle of Hakodate Bay, the Ezo forces were defeated, and Arai was placed in prison, where he remained pending a sentence of death.During this time, he wrote the first English-Japanese dictionary.With his sentence of death commuted, Arai worked with Enomoto in land reclamation for a time, before working in the Agricultural School, as well as becoming head of a women's school.