The spokesman says the gunman was shot dead by Afghan troops at the prison .