Trump had pledged to ban the devices soon after a gunman used them to shoot and kill 58 people last year.