The Canongate is a street and associated district in central Edinburgh, the capital city of Scotland. The street forms the main eastern length of the Royal Mile while the district is the main eastern section of Edinburgh's Old Town. It began when David I of Scotland, by the Great Charter of Holyrood Abbey c.1143, authorised the Abbey to found a burgh separate from Edinburgh between the Abbey and Edinburgh. The burgh of Canongate that developed was controlled by the Abbey until the Scottish Reformation when it came under secular control. In 1636 the adjacent city of Edinburgh bought the feudal superiority of the Canongate but it remained a semi-autonomous burgh under its own administration of bailies chosen by Edinburgh magistrates, until its formal incorporation into the city in 1856.