The women were freed “safe and sound”, officials said.
The 17-year-old hostage-taker remained holed up alone in the establishment in the north-west Blagnac suburb of the city for a couple of hours afterwards before finally being arrested following protracted negotiations, Interior Minister Christophe Castaner said on Twitter.
The teen, “who is nearly 18, has a police record for incidents of violence, notably against police officers, for robbery, and also for participating in December in a 'yellow vest' (anti-government) protest during which he was arrested,” Toulouse chief prosecutor Dominique Alzeari earlier told a news conference.
He was not “someone who was classed as dangerous” previously, he said.
The gunman, who was not identified publicly, burst into the bar in the afternoon, firing two shots and allegedly warning he would fire on police if they approached, Alzeari said.
He left a letter at his home “in which he seemed fairly depressive, or at least worried about his state of health, and he made mention of the 'yellow vest' movement but stating that the act he was about to commit would not go beyond what turned out to be not so impressive,” he said.
The mayor's office in Blagnac said earlier there was “no suspicion of a terrorist motive” in the incident, an evaluation shared by police.
The gunman released the female owner of the bar first, then a short time later the three women who some witnesses said included bar staff.
A delivery man who said he knew the father of the gunman told media outside the police cordon at the scene that the teen, named “Yanis”, was a local resident from a nearby downmarket neighbourhood.
He said police had brought the mother to the scene, apparently to help with negotiations.