Chang Mai was founded in 1296 by King Mangrai as the capital of the Lanna Kingdom. Because the “New City” was under constant threat of attack, it was fortified by a wall and moat. The core of the historic city is still defined by this ancient defense footprint. The five reconstructed gates remain as does the surrounding canal and portions of the walls like the Ku Huang Corner in the southwest.