'You could have killed someone,' the magistrate told him.