The man initially demanded money but when he was refused, a shot was fired and the hostages taken.
Claiming to be linked to al-Qaeda, he demanded to speak to the elite Raid police unit that killed Islamist gunman Mohamed Merah nearby in March.
He freed two hostages before police stormed the bank and detained him.
The gunman was said to have been wounded in the thigh, but not seriously. His two remaining hostages are not thought to have been harmed.
The man went into the branch of the CIC bank at 10:10 local time (08:10 GMT), taking the manager and three other people hostage.
The area around the bank was cordoned off and two nearby schools were closed.
Special police units from the GIPN (Groupe d’intervention de la police nationale) arrived from Marseille and Bordeaux.
No officers from Raid – which has its headquarters north of Paris, about 600 km (400 miles) from Toulouse – were deployed to the scene.
A police union source told the regional newspaper Ouest-France it was not clear whether the man’s claim about al-Qaeda was “serious or a fantasy”.
More than four hours into the siege, police said a woman hostage had been freed in exchange for food and water. A second woman was released some time afterwards.
Public prosecutor Michel Valet told reporters that the man “wishes to let it be known that he is not acting for money, but for religious reasons”.
The hostage-taker was believed to be around 30 years old and known to the authorities, Toulouse newspaper La Depeche reported. He was from Castres, to the east of Toulouse, and one source told the paper he was a schizophrenic who had broken off his treatment.
His sister, who was brought to the scene during the afternoon to help in negotiations, revealed that her brother was not religious and had been in and out of social care since childhood.
After almost seven hours, the siege came to an end. Three explosions had been heard, possibly stun grenades, shortly before news emerged of the gunman’s arrest.
The gunman had come out of the building with one of the two hostages, reportedly threatening him with a gun, prompting the special police unit to launch its assault.
He was shot in the thigh, La Depeche reported, before being arrested. He was then taken to hospital.
The bank in which the drama unfolded is a few hundred metres from Mohamed Merah’s flat, in an area adjacent to the barracks where Raid police were based during the March siege that ended in his death.
Mohamed Merah, a 23-year-old Frenchman of Algerian descent, killed seven people in three separate attacks before he was shot dead by police. His victims included three children and a teacher at a Jewish school, and three soldiers.
Mohamed Merah filmed his attacks and sent the footage to police.
He was shot dead by a police sniper on 22 March after commandos stormed his flat.
Mohamed Merah was suspected to have had an accomplice within the Muslim community.
In the wake of the shootings, the French authorities set up an investigation into whether Mohamed Merah had accomplices and into possible Islamist indoctrination practices in prisons.
They have shown zero tolerance to anyone known to have used Islamist internet sites or to have had links to a fringe al-Qaeda group to which Mohamed Merah is said to have belonged.
On 7 June, a man armed with a shotgun took hostage a security guard at the French weather service, Meteo France. The hostage-taker fired several shots and was seriously injured when police returned fire.
His hostage was uninjured.
jNPRzwNJIs8 u0T5jr3vzwMImage source: Wikimedia Commons President-elect Donald Trump celebrated his election victory at the Ultimate Fighting…
Millions of voters across the US chose to return Donald Trump to the White House…
Donald Trump declares victory in the US election as he addresses jubilant supporters in Florida.…
Stocks around the world are rising as Donald Trump appears to be on the cusp…
Donald Trump has won Pennsylvania, North Carolina and Georgia and taken a lead over Kamala…
Quincy Jones, the celebrated musician and producer who worked with Michael Jackson, Frank Sinatra, Ray…