The phrase अहिंसा परमो धर्म, largely popularized by Mahatma Gandhi is repeated by many across the world to emphasize non-violence. The phrase was first used in the epic Mahabharata and means non-violence is the ultimate duty. But, this is the half-truth. The full phrase is:
अहिंसा परमो धर्म: |
धर्म हिंसा तथिव च |
The second line means so too is violence in service of duty. The word non-violence in English is in absolute send but the word अहिंसा is relative; specifically to one who has renounced.
In Sanatana Dharma it’s the moral duty of a person to practice violence if it’s used to stop a greater violence or evil. For example, in order to keep peace and order in his country, a king has to be strict in his punishment—he may have to kill someone to safeguard his kingdom.
During the war of Mahabharata when Arjuna—the great warrior—wants to leave the battlefield, Lord Krishna address him through the Holy Bhagvad Gita and explains to him that he would be a sinner if he gives up the holy war for righteousness, and runs away from his duties to establish faith and justice.
Even for a householder, the act of non-violence may not be practical. For example, practicing non-violence when someone enters the house and molests his wife and child would be an act of cowardice. Similarly, a soldier cannot put down his weapons and let the opponent attack his country.
To protect the righteous, to annihilate the wicked, and to re-establish the principles of dharma I appear on this earth, age after age. Bhagvad Gita 4:8