Brecon, archaically known as Brecknock, is a market town and also community in Powys, mid-Wales. In 1841, it had a population of 5,701. The population in 2001 was 7,901, increasing to 8,250 at the 2011 census. Historically it was the county town of Brecknockshire (Breconshire); although its function thus was eclipsed with the formation of the County of Powys, it stays an essential local centre. Brecon is the third-largest community in Powys, after Newtown as well as Ystradgynlais. It lies north of the Brecon Beacons chain of mountains, however is just within the Brecon Beacons National Park.