The soldier accidentally crossed the border into the neighboring country.
Tips
usage
越界 is used both literally (crossing a physical border) and figuratively (overstepping social or professional boundaries). The figurative use is very common in modern speech.