Getting along with neighbors is always a challenge.

Colonial Maryland and Pennsylvania had it harder than most: they both had legitimate (to them) claims to a large area of land. It was this competing interest that led to Cresap’s War, also known as the Conjocular War, a bloody eight-year conflict over the city of Philadelphia and surrounding area.

This little-known border conflict eventually required the British crown to step in and restore peace. Memory of the conflict was one of the original reasons that the Calvert and Penn families, the founders of Maryland and Pennsylvania, respectively, paid for the Mason-Dixon line to be surveyed.

Pennsylvania's charter described its boundaries in complicated (by modern standards) terms, saying that its southern border should be "a Circle drawne at twelve miles distance from New Castle [Delaware] Northward and Westward unto the beginning of the fortieth degree of Northern Latitude, and then by a streight Line Westward to the Limitt of Longitude above-mentioned." However, whoever surveyed the colony made a serious geographical error, since the 40th Parallel was north of Philadelphia—which would have put the growing city in Maryland, not Pennsylvania.

The two colonies began arguing about where the border actually was. In 1724, the British crown told them to work it out politely. Of course, nobody listened. “Despite the Crown’s mandate, Pennsylvania created Lancaster County, clearly extending south of the border as claimed by Maryland,” writes trivia expert Dan Lewis.

Maryland responded by getting Thomas Cresap, a man who had been a land agent for the Calvert family of Maryland, to build a settlement by the Susquehanna River. He did so and began doing business with the Pennsylvania Dutch, claiming the taxes they paid for the government of Maryland. In time, the trading post he built became an important Maryland outpost.

Then in 1736, according to the National Park Service, he was accused of murder by the Pennsylvanians and captured after his house was set on fire. After this, the government of Maryland petitioned King George to intervene and settle the boundary dispute once and for all. The colonies never officially declared war on each other, but small border skirmishes kept occurring, and it wasn’t until this day in 1738 that the two colonies signed a peace treaty agreeing to a permanent border, and to not "permit or suffer any Tumults Riots or other Outragious Disorders to be committed on the Borders of their respective Provinces."

That border they settled on was about 15 miles south of Philadelphia, writes David Anderson for the Baltimore Sun.

In 1750, writes Lewis, the court made the original agreement binding and declared that the border sat at “roughly 39 degrees and 40 minutes north.” Seventeen years later, surveyors Charles Mason and Jeremiah Dixon, hired by the Penns and Calverts, made the Mason-Dixon Line official.