米沢藩
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. The new government also ordered him to retire from his position, and reduced Nihonmatsu Domain from its "kokudaka" of 100,700 "koku" to 50,700 "koku". His adopted son Niwa Nagahiro (brother of Uesugi Mochinori of Yonezawa Domain) succeeded him.