A gunman who took four people hostage in a bank in the southern French city of Toulouse on Wednesday has been captured and the hostages released, a police official said.