To the north, Mangrai, who descended from a local ruler lineage of Ngoenyang, founded the kingdom of Lan Na in 1292, centered in Chiang Mai. He unified the surrounding area and his dynasty would rule the kingdom continuously for the next two centuries. He also created a network of states through political alliances to the east and north of the Mekong. While in the port in Lower Chao Phraya Basin, a federation around Phetchaburi, Suphan Buri, Lopburi, and the Ayutthaya area was created in the 11th century.