On May 17.1869 ; Imperial Japanese forces defeat the remnants of the Tokugawa shogunate in the Battle of Hakodate to end the Boshin War.