The concept of a literal “line in the sand” was first created by a lone Roman senator who rode out to meet a Macedonian king at the head of an army poised to invade Egypt, a Roman protectorate.
The king balked until the senator drew a circle around him in the sand and demanded that he order a withdrawal before stepping out of that circle or face the wrath of Rome.
The king paused and then complied.
This account has been verified by contemporary historians.
The senator was Popillius Laenas.