SB 1.7.53-54

śrī-bhagavān uvāca
brahma-bandhur na hantavya
 ātatāyī vadhārhaṇaḥ
mayaivobhayam āmnātaṁ
 paripāhy anuśāsanam
kuru pratiśrutaṁ satyaṁ
 yat tat sāntvayatā priyām
priyaṁ ca bhīmasenasya
 pāñcālyā mahyam eva ca
Synonyms: 
śrī-bhagavān — the Personality of Godhead; uvāca — said; brahma-bandhuḥ — the relative of a brāhmaṇa; na — not; hantavyaḥ — to be killed; ātatāyī — the aggressor; vadha-arhaṇaḥ — is due to be killed; mayā — by Me; eva — certainly; ubhayam — both; āmnātam — described according to rulings of the authority; paripāhi — carry out; anuśāsanam — rulings; kuru — abide by; pratiśrutam — as promised by; satyam — truth; yat tat — that which; sāntvayatā — while pacifying; priyām — dear wife; priyam — satisfaction; ca — also; bhīmasenasya — of Śrī Bhīmasena; pāñcālyāḥ — of Draupadī; mahyam — unto Me also; eva — certainly; ca — and.
Translation: 
The Personality of Godhead, Śrī Kṛṣṇa said: A friend of a brāhmaṇa is not to be killed, but if he is an aggressor he must be killed. All these rulings are in the scriptures, and you should act accordingly. You have to fulfill your promise to your wife, and you must also act to the satisfaction of Bhīmasena and Me.
Purport: 

Arjuna was perplexed because Aśvatthāmā was to be killed as well as spared according to different scriptures cited by different persons. As a brahma-bandhu, or a worthless son of a brāhmaṇa, Aśvatthāmā was not to be killed, but he was at the same time an aggressor also. And according to the rulings of Manu, an aggressor, even though he be a brāhmaṇa (and what to speak of an unworthy son of a brāhmaṇa), is to be killed. Droṇācārya was certainly a brāhmaṇa in the true sense of the term, but because he stood in the battlefield he was killed. But although Aśvatthāmā was an aggressor, he stood without any fighting weapons. The ruling is that an aggressor, when he is without weapon or chariot, cannot be killed. All these were certainly perplexities. Besides that, Arjuna had to keep the promise he had made before Draupadī just to pacify her. And he also had to satisfy both Bhīma and Kṛṣṇa, who advised killing him. This dilemma was present before Arjuna, and the solution was awarded by Kṛṣṇa.