Why was he encouraging His disciples to defend themselves through violence?
Don't be surprised, it goes well with:
Matthew 10:34
"Do not suppose that I have come to bring peace to the earth. I did not come to bring peace, but a sword."
Luke 12:49-53
"49 I have come to bring fire on the earth, and how I wish it were already kindled!
50 But I have a baptism to undergo, and how distressed I am until it is completed!
51 Do you think I came to bring peace on earth? No, I tell you, but division.
52 From now on there will be five in one family divided against each other, three against two and two against three.
53 They will be divided, father against son and son against father, mother against daughter and daughter against mother, mother-in-law against daughter-in-law and daughter-in-law against mother-in-law."
Luke 14:25-27
25 Large crowds were traveling with Jesus, and turning to them he said:
26"If anyone comes to me and does not hate his father and mother, his wife and children, his brothers and sisters—yes, even his own life—he cannot be my disciple."