Following the
Boshin War in 1868, Kondō and Hijikata led the Shinsengumi in their final battles against the new government and fought in the
Battle of Toba–Fushimi in January 1868. The Shinsengumi returned to
Edo and was later reformed into a unit known as the and departed from Edo for
Kōfu Castle on March 24 upon orders to suppress the uprisings there. But while on the way there, they received news on March 28 that the Kōfu Castle was taken by Imperial Court forces led by
Itagaki Taisuke and later settled at the town of Katsunuma five miles east of Kōfu. On March 29, 1868, Kondō, Hijikata and the Kōyō Chinbutai resisted an attack by the Imperial forces at the
Battle of Kōshū-Katsunuma for about two hours but lost, and they were scattered and fled to Edo. On April 11, 1868, Kondō, Hijikata and the Kōyō Chinbutai departed Edo again and later set up a temporary headquarters at the Kaneko family estate, northeast of Edo. They later moved to a new quarters in
Nagareyama on April 25, 1868. During the training at Nagareyama on April 26, 1868, the Kōyō Chinbutai were caught by surprise by the 200 strong Imperial forces led by Vice-chief of Staff
Arima Tota of
Satsuma Domain and Kondō was ordered to go with them to their camp at
Koshigaya. He was later brought to
Itabashi on April 27, 1868, for questioning. On the same day Hijikata went to Edo to see
Katsu Kaishū and asked for his help in getting a pardon for Kondō. On the following day, a messenger arrived at Itabashi with a letter seemingly written by Katsu requesting that Kondō's life to be spared, but the messenger was arrested and the request was denied. Following his trial on April 30, 1868, Kondō was executed at
Itabashi execution grounds on May 17, 1868. Hijikata, convalesced from a foot injury sustained at the
Battle of Utsunomiya Castle, brought Kondō's strands of hair to Aizu and was said to have personally supervised the erection of Kondō's grave memorial at Tenneiji Temple. Following the
Battle of Bonari Pass, the next day on October 7, 1868, Hijikata met
Saitō Hajime at the
Inawashiro Castle and stayed at the Saitoya inn in Wakamatsu. When Hijikata decided to retreat from Aizu, Saitō and a small group of Shinsengumi parted with Hijikata and continued to battle in the
Battle of Aizu until the very end. Hijikata and his rest of the Shinsengumi went to
Sendai, where he joined up with
Enomoto Takeaki's fleet. He knew he was fighting a losing battle, and told the physician
Matsumoto Ryōjun: I am not going to battle to win. With the Tokugawa government about to collapse, it would be a disgrace if no one is willing to go down with it. That is why I must go. I will fight the best battle of my life to die for the country. In October 1868, Hijikata and
Ōtori Keisuke led Shogunate forces to occupy the fortress of
Goryōkaku in the
Battle of Hakodate, and continued to eliminate local resistance. When the short-lived
Ezo Republic was founded in December, Hijikata was made a Deputy Defence Minister (Vice-minister of the Army). Imperial troops continued to attack by land and sea. On May 6, 1869, Hijikata led a daring but doomed raid to steal the imperial warship
Kōtetsu in the
Battle of Miyako Bay, in the early morning, a number of oppositionists managed to board the ship via the
Kaiten warship, but
Kōtetsu repelled the attack and mowed them down with a
Gatling gun. Many others including the captain of
Kaiten were also killed by gunfire from the Imperial ships. The battle lasted only thirty minutes; Hijikata, the survivors and the
Kaiten retreated to Hakodate. Later on the fourth week of May 1869, Hijikata led the 230-strong Republic of Ezo forces and the surviving Shinsengumi against 600 strong Imperial forces during the
Battle of Futamata for sixteen hours and were forced to retreat. The Imperial forces attacked again on the next day, only to retreat. On the following night, Hijikata led a successful raid on the Imperial forces' camp, forcing them to flee. Hijikata and the forces later retreated to Hakodate on June 10.
Death During the
Battle of Hakodate, the final battle of the
Boshin War, Hijikata summoned his 16-year-old
page,
Ichimura Tetsunosuke on June 14 (
lunar calendar May 5), 1869, to a private room in an inn. There, he entrusted Ichimura with a death poem, his
katana, a letter, a photograph of himself, and several strands of his hair. Ichimura was instructed to bear them to the home of Hijikata's brother-in-law Satō Hikogorō in
Hino. The death poem entrusted to Ichimura reads: Though my body may decay on the island of Ezo, my spirit guards my lord in the East. In the final conflict of the revolution, on June 20 (lunar calendar May 11), 1869, Hijikata was killed near the Ippongi Kanmon (一本木関門) by a bullet that shattered his lower back while leading his troops on horseback. His body was later claimed by Koshiba Chōnosuke and others. Three days later on June 23 (lunar calendar May 14), 1869, a group of surviving Shinsengumi members under the last commander
Sōma Kazue surrendered at
Benten Daiba. A week after Hijikata's death, the Goryōkaku fortress was taken and all military forces of the Ezo Republic surrendered to the
Meiji government on June 27, 1869, marking the end of Boshin War. It is unknown where Hijikata was buried but it is believed that his body was laid to rest either at Goryōkaku,
Hekketsuhi or Ganjoji. ==Grave memorials and monuments==