Even Jesus, when he knew his departure was near, told his disciples to take a sword with them. Why?

Not for aggressive purposes; but for defense and protection.

"He said to them, "But now if you have a purse, take it, and also a bag; and if you don't have a sword, sell your cloak and buy one." (Luke 22:36)