My understanding is that, throughout most of history, nations didn't have sharp borders like we do today. The distinction between nations was more fluid. What was the first instance of two nations precisely defining an imaginary line and saying "we're on this side of the line and you're on the other side"?
There are likely some before, but from an International Relations perspective, consensus is generally around the Treaty of Westphalia in 1648 being the first modern treaty as it formalised the concept of a sovereign state. Wiki has quite a god breakdown of what the treaty actually consisted of. I can't really source as I'm an International Relations graduate and, on my course, all the lecturers accepted this as fact. There are likely treaties before this, but Westphalia is the first one that we would recognise today.