 In 1868, with the start of the Boshin War, Nihonmatsu joined the Ōuetsu Reppan Dōmei, but was defeated by the forces of the Satchō Alliance in every engagement.Nihonmatsu Castle fell during the Battle of Nihonmatsu on September 15, 1868 and Niwa Nagakuni fled to Yonezawa Domain.He subsequently made peace with the Meiji government and was ordered to relocated to Tokyo, where he was held under house arrest at the residence of Maebashi Domain.