The hostage-taker, a 34-year-old with a history of mental illness, emerged slowly from the building wearing a balaclava and with his hands turned palms-up, before officers with their weapons raised moved in and handcuffed him.
All the hostages were unharmed, though in shock, said Denis Jacob of the Alternative police trade union.
Bomb squad officers acted after the man told officers there were explosives in a bag. He had been armed with a handgun, a national police representative told Reuters.
The man initially took six people hostage. Five were subsequently released and the sixth taken to safety after the man was arrested, according to Jacob.
The hostage-taker was believed to have Islamist sympathies, two police union officials said, but there was no official confirmation of this.
Militant attacks have shaken France in recent years, with four police officers killed in an October 2019 knife rampage in Paris and 130 people killed by coordinated bombings and shootings in the capital in November 2015.
Yves Lefebvre, head of another police union, SGP Unite, said the hostage-taker in Le Havre, a town of around 170,000 people on the English Channel, was known to law enforcement authorities and on a security service watch list.
"We know that he has been radicalized and suffers a serious psychiatric illness," he said.
Another source, a senior police official, said that during the incident the man spoke in support of the Palestinian cause. He walked out of the bank with what appeared to be a green-colored flag draped around his shoulders.
Police had cordoned off the area around the bank on Boulevard de Strasbourg, a wide thoroughfare in the center of Le Havre.
An employee at a Burger King outlet about 100 meters from the bank said police had told them to lock an entrance on the same street as the hostage-taking but not ordered them to shut.
When the fifth hostage was freed, a man in a pink shirt could be seen in Reuters television footage being led away from the bank by a police officer in full protective gear.
"Very proud and grateful," former prime minister Edouard Philippe, now Le Havre's mayor, wrote on Twitter in praise of the police.The hostages were seized in a branch of Bred bank, a mid-sized lender, on the ground floor of a six-story residential building.