The judge who jailed the man for the attack at an anti-government protest said he was a victim.