Deuteronomy 23:5

5 Nevertheless the LORD your God would not hearken to Balaam; but the LORD your God turned the curse into a blessing for you, because the LORD your God loved you.

Deuteronomy 23:5 In-Context

3 "No Ammonite or Moabite shall enter the assembly of the LORD; even to the tenth generation none belonging to them shall enter the assembly of the LORD for ever;
4 because they did not meet you with bread and with water on the way, when you came forth out of Egypt, and because they hired against you Balaam the son of Be'or from Pethor of Mesopota'mia, to curse you
5 Nevertheless the LORD your God would not hearken to Balaam; but the LORD your God turned the curse into a blessing for you, because the LORD your God loved you.
6 You shall not seek their peace or their prosperity all your days for ever.
7 "You shall not abhor an E'domite, for he is your brother; you shall not abhor an Egyptian, because you were a sojourner in his land.
Revised Standard Version of the Bible, copyright 1952 [2nd edition, 1971] by the Division of Christian Education of the National Council of the Churches of Christ in the United States of America. Used by permission. All rights reserved.