'Ahiṃsā paramo dharmaḥ' appears several times in the Mahābhārata (e.g. Ādi Parva and Anuśāsana Parva). The popular second line 'dharma hiṃsā tathaiva ca' is not found in the Mahābhārata critical edition. The epic does discuss just war elsewhere, but this particular couplet is a modern addition.
Read sources & contribute → sanatanfacts.online