From A Wiki of Ice and Fire
Around 700 years before Aegon's Landing, the expansion of the Valyrian Freehold into the western coastal regions of Essos threatened the great city-states of the Rhoyne, a vast river network of the east. The ruler of one of them, the warrior queen Nymeria, managed to unite the Rhoynar and they began an evacuation to Westeros, allegedly fleeing in ten thousand ships across the Narrow Sea. The fears of the Rhoynar were proven when the Valyrians destroyed the city of Arnar, which had tried to resist them.
Nymeria's host landed on the eastern coast of Dorne. Nymeria made common cause with Mors Martell, the most powerful Dornish lord among the dozens if not hundreds of powerful lords controlling the patchwork of states in Dorne. With Nymeria's vast host at his command, Mors was able to unite the entire peninsula of Dorne under his rule. No less than seven self-styled rival Dornish kings were captured and sent to the Wall in golden fetters. In the Rhoynar style, he took the title "Prince" and introduced equal primogeniture. The fortress of Sunspear was made capital of Dorne, and House Martell has ruled ever since.