Deuteronomy 2:19 (ESV)

19 And when you approach the territory of the people of Ammon, do not harass them or contend with them, for I will not give you any of the land of the people of Ammon as a possession, because I have given it to the sons of Lot for a possession.’

The people of Ammon were north and somewhat east of Moab. Israel, therefore, did not need to travel directly through Ammon on the way to the Promised Land. Even though they passed close to the Ammonites, and might have been tempted to wage war with them, the Lord barred them from doing so. Israel was to treat them in the same way as the Moabites.