Srimad Valmiki Ramayana

सर्वथा धर्म इति एव द्रष्टव्यः तव निग्रहः ।
वयस्यस्य उपकर्तव्यम् धर्मम् एव अनुपश्यता ॥४-१८-२९॥
sarvathā dharma iti eva draṣṭavyaḥ tava nigrahaḥ |
vayasyasya upakartavyam dharmam eva anupaśyatā ॥4-18-29॥
Translation
Your punishment should be viewed entirely as an act of Dharma. For one who keeps Dharma in view, rendering assistance to a friend is indeed a duty.
हिंदी अनुवाद
तुम्हारा वध सर्वथा धर्म ही है, ऐसा (तुम्हें) देखना चाहिए। धर्म को ही देखने वाले (मेरे जैसे) व्यक्ति के लिए मित्र का उपकार करना कर्तव्य है।
English Commentary
Rama asserts that his action is 'sarvathā dharma' (wholly Dharma), without a trace of unrighteousness. Assisting a 'vayasya' (friend) is also an integral part of Dharma. Often, one sees a conflict between personal friendship and royal duty, but Rama synthesizes them here. Suppressing the wicked is 'Rajadharma' and helping a friend is 'Mitradharma'—in this specific case, both are fulfilled by the single act of killing Vali. Rama urges Vali to view the situation through the lens of Dharma ('anupaśyatā'), just as Rama does.
हिंदी टीका
राम यहाँ इस बात पर जोर देते हैं कि उनका कार्य 'सर्वथा धर्म' (पूरी तरह से धर्म) है, इसमें कहीं भी अधर्म का लेश नहीं है। 'वयस्य' (मित्र) का उपकार करना भी धर्म का ही अंग है। प्रायः लोग व्यक्तिगत मित्रता और राजधर्म में संघर्ष देखते हैं, किन्तु राम यहाँ दोनों का एकीकरण (synthesis) करते हैं। दुष्ट का दमन करना 'राजधर्म' है और मित्र की सहायता करना 'मित्रधर्म' है—इस स्थिति में दोनों का पालन एक ही कार्य (वाली वध) से हो रहा है। राम वाली को अपनी दृष्टि ('अनुपश्यता') से स्थिति को देखने का आग्रह कर रहे हैं।