Following negotiations with the first deputy chief of national police, Yevhen Koval, the man released three of the hostages, including a pregnant woman in the western city of Lutsk.
Mr Koval also delivered water to the hostages. At one point, the assailant fired his gun and a bullet narrowly missed the police chief.
Shortly after, Ukraine’s President Volodymyr Zelenskiy posted a brief video message on his Facebook page to urge Ukrainians to watch a film — as the hostage-taker had wanted.
Minutes later, the assailant surrendered to police and authorities said all 13 hostages were freed.
Speaking to reporters after the drama ended, Ukraine’s Interior Minister Arsen Avakov described the assailant as an “unstable man who invented his own world”.
Police sealed off the centre of Lutsk, 250 miles west of the capital Kyiv after the assailant, who police said was armed and carrying explosives, took over the bus.
At one point, the assailant threw explosives out of the bus window, but no-one was hurt. He also fired several shots at a police drone.
The man called the police himself at 9:25am local time after taking control of the vehicle and introduced himself as Maksim Plokhoy, Deputy Interior Minister Anton Gerashchenko said on Facebook.
According to Mr Gerashchenko, police have identified the man as Maksim Krivosh, a 44-year-old Ukrainian born in Russia.
Krivosh had reportedly been convicted twice on a wide range of charges — robbery, fraud, illegal arms handling — and spent a total of 10 years behind bars.
According to reports, Krivosh tried to reach out to journalists through hostages and their phones, demanding that they spread the word about his demands and get more reporters to arrive at the scene.