Conan and Heiji convene to meet with Brian D. Kadokura at the
Goryōkaku (五稜郭), the Hakodate Pentagram, so they could explain the truth of where the treasure is located. Taking into account the old pictures of Keizaburo Onoe in a hot air balloon that had a glass bottom, one would need to put the sword vertically on the glass and align the pentagram motif of the
crossguard with the actual Pentagram when seen from above, then at the height they become perfectly aligned, look from the top of the sword, not from the crossguard. At the same time, the Detective Boys and professor Agasa test that on Agasa's newly created hot-air balloon, and when they get to right height, Haibara has Mitsuhiko light a laserbeam towards the actual location of the treasure,
Mount Hakodate.
After the treasure has been revealed, Heiji and Conan ask Kadokura to release Ryoe and stop his antics, but Kadokura laughs and says he actually planted a bomb all over the city and holds it hostage. However, Nacho snatches away the detonator from his boss and jumps on the rooftop of the barracks, revealing himself to be Kaitou Kid in disguise. The real Nacho had been bound and gagged. Kid helps Heiji and Conan fight off Kadokura. Kadokura sends his men to attack Heiji and Conan, but two new contenders arrive, Okita, whom Heiji called for backup, and Onimaru, whom Okita had noticed was participating at the tournament. As he sees his men get taken down, Kadokura escapes with a few more henchmen. Conan immediately asks Ayumi to drop his skateboard from the hot-air balloon, and it lands right down at the Pentagram. Conan picks it up and starts running after Kadokura, while Kid disappears. Heiji asks Onimaru and Okita to take care of the remaining men while he left after looking at his phone, which is showing Hijiri's location.
Later, Momiji and Iori, who are in the helicopter above Hakodate, notice that Conan is involved in car chase and decide to drop flash bombs to take down some of the cars, and thus, Conan is able to chase after Kadokura alone.
Meanwhile, Hijiri is on the move, as he notices the laserbeam and he starts his plane towards the target. Before Hijiri manages to take off, Heiji manages to catch up to him and he grabs the plane's tail wing. Hijiri, getting angry, puts the plane in autopilot and jumps on the wing and both have a sword duel. Meanwhile, Conan manages to disable Kadokura's car just before he can get to the mountain top, and the latter furiously gets out of the car and tries to shoot Conan dead. Suddenly, Ryoe appears from behind and lands an Iai move on him, knocking him out, as well as his accomplice. Conan smiles, as he had seen as similar move before. Indeed, Ryoe Fukushiro is Sumito Hisagaki's murderer and the one that tried to kill Kid. Conan notices that his stance is the same as the attacker and that he has a slash on the hand, an injury common to iaidoka which Conan noticed when Ryoe took his medicine a while ago. Ryoe applauds him for his intelligence. Conan noticed that even though Tadayuki Onoe could not walk, he still had pictures of him in nature and mountains, and realized that Ryoe was the one who drove him around. Tadayuki then tasked him to find and destroy the treasure before he passed away. He killed Hisagaki because he started to deal with Kadokura and that was a threat to the treasure, and he framed his own son to distract Kadokura.
Meanwhile, during their fight, Hijiri Fukushiro explains that his mother died while in a humanitarian mission from a bomb while trying to save children, and thus, thinking that the treasure is dangerous and could potentially harm people, he and his father sought to destroy it. Heiji tells him that there is should not forget what he really wants to do, to study medicine like his mother, instead of blindly following his father's wishes.
During the fight, Heiji falls from the plane, but Kid arrives on his hang-glider cape and picks up Heiji and helps him get back on the plane's wing. After that, Heiji lands a final blow to Hijiri, knocking him out. He, however, is not able to pilot the plane, but manages to drop the bomb to the sea, and later jumps with a parachute carrying unconscious Hijiri before the plane crashed, saving the people on the mountain.
After Conan and Ryoe confirmed that Heiji and Hijiri is safe, Kadokura gets up and tries to shoot them one last time, but is shot in the arm by a smiling detective Kawazoe. After that, Ryoe, Conan, and Kid, who just landed, get to the treasure, but when Ryoe sees there is only a small box, he gets angry and smashes it. Conan explains that the real treasure was never gold bars, and that Keizaburo invested all his money in this cipher machine, which was the real treasure for its time. Ryoe falls to the ground, realizing he had been pursuing futile endeavors.
Kadokura and Ryoe are taken away by the Hokkaido Police. When Nishimura is arresting Kadokura, Kawazoe arrives at the crime scene much later, where he explains that he won a lottery and was on holiday for the last 3 days, making Nishimura wonder who the Kawazoe he worked with earlier was.
Ran and Kazuha, on the observation deck, see Heiji landing with Hijiri and Ran applauds him, thinking that he could not have found a better way to confess. When they land, Hijiri starts to regain consciousness, but Ran knocks him out and brings him away, giving the two childhood friends the best occasion to confess. Heiji takes Kazuha to the top of the observation deck and prepares to confess, but Momiji and Iori, who are watching them from above, accidentally drop a flash bomb, which lands on Heiji and Kazuha. After the bomb explodes, both get up, and Heiji confesses to Kazuha...
During mid credit scenes, Aoko is seen feeding her recovering father Ginzo some apples at the hospital. Okita and Onimaru walk away from the Pentagram while enjoying the spring cherry blossoms and Okita thinks about Onimaru, whose voice reminded him of Hijikata Toshizō. Takuzo regains consciousness at the hospital, but is surrounded by the Hokkaido Police, who are ready to arrest them. At the same time, inspector Nishimura calls subordinates, having defused the bombs Kadokura placed.
Post-credit
After Heiji confesses to Kazuha, she stares at him crying, saying that she cannot hear anything since she covered Heiji and was exposed to the bomb. Heiji gets flustered after knowing that Kazuha didn't hear his confession.
At the
Kudo residence, Yusaku reveals to Yukiko that he has twin brother, but both were separated after their parents divorced. At the same time, he writes to a certain
T. K., talking about his latest novel. Yusaku also says that while he hasn't meet his twin brother for 20 years, Yukiko might have meet him once. He also said that his brother gave him a sword, which is revealed to be Keizaburo's missing sword. At the top of a tower, the
other Kawazoe takes off his disguise, revealing himself to be
Kaitou Corbeau, who is also the one writing back to Yusaku while signing with
T. K.