. The castle was at the south end of the settlement. War broke out again between England and Wales on 22 March 1282. The Welsh leader, Llywelyn ap Gruffudd, died later that year on 11 December. His brother
Dafydd ap Gruffydd continued to fight against the English, but in 1283 Edward I was victorious. Edward marched through northern Wales, capturing castles such as that at
Dolwyddelan, and establishing his own at
Conwy. War finally drew to a close in May 1283 when
Dolbadarn Castle, Dafydd ap Gruffudd's last castle, was captured. Shortly afterwards, Edward began building castles at
Harlech and Caernarfon. The castles of Caernarfon, Conwy and Harlech were the most impressive of their time in Wales, and their construction—along with other Edwardian castles in the country—helped establish English rule. The master
mason responsible for the design and construction of the castle was probably
James of Saint George, an experienced architect and military engineer who played an important role in building the Edwardian castles in Wales. According to the
Flores Historiarum, during the construction of the castle and planned town, the body of the Roman emperor
Magnus Maximus was discovered, and Edward I ordered its reburial in a local church. The construction of the new stone castle was part of a programme of building which transformed Caernarfon; town walls were added, connected to the castle, and a new quay was built. The earliest reference to building at Caernarfon dates from 24 June 1283, when a ditch had been dug separating the site of the castle from the town to the north. A
bretagium, a type of
stockade, was created around the site to protect it while the permanent defences were under construction. Timber was shipped from as far away as Liverpool. A force of hundreds worked on the excavation of the moat and digging the foundations for the castle. As the site expanded, it began to encroach on the town; houses were cleared to allow the construction. Residents were not paid compensation until three years later. While the foundations for the stone walls were being created,
timber-framed apartments were built for Edward I and
Eleanor of Castile, his queen. They arrived at Caernarfon on either 11 or 12 July 1283 and stayed for over a month. The
Statute of Rhuddlan, enacted on 3 March 1284, made Caernarfon a
borough and the administrative centre of the county of Gwynedd. According to tradition,
Edward II was born at Caernarfon on 25 April 1284. Edward was created
Prince of Wales in 1301, with control over Wales and its incomes. Since then the title has traditionally been held by the eldest son of the monarch. According to a famous legend, the king had promised the Welsh that he would name "a prince born in Wales, who did not speak a word of English" and then produced his infant son to their surprise; but the story may well be apocryphal, as it can only be traced to the 16th century. In 1284, Caernarfon was defended by a garrison of forty men, more than the thirty-strong garrisons at Conwy and Harlech. Even in peace time, when most castles would have a guard of only a few men, Caernarfon was defended by between twenty and forty people due to its importance. By 1285, Caernarfon's
town walls were mostly complete. At the same time work continued on the castle. Spending on construction was negligible from 1289 and accounts end in 1292. Edward I's campaign of castle-building in Wales cost £80,000 between 1277 and 1304, and £95,000 between 1277 and 1329; by 1292 £12,000 had been spent on the construction of Caernarfon's castle—of which the southern façade was furthest along—and town walls. As the southern wall and town walls completed a defensive circuit around Caernarfon, the plan was to build the castle's northern façade last. In the summer of 1295, the English moved to retake Caernarfon. By November the same year, the English began refortifying the town. Rebuilding the town walls was a high priority, and £1,195 (nearly half the sum initially spent on the walls) was spent on completing the job two months ahead of schedule. Attention then shifted to the castle and on finishing the work that had halted in 1292. as a result,
Walter of Hereford took over as master mason for the new phase of construction. By the end of 1301, a further £4,500 had been spent on the work; the focus of the work was on the northern wall and towers. The accounts between November 1301 and September 1304 are missing, possibly because there was a hiatus in work while labour moved north to help out with England's war against Scotland. Records show that Walter of Hereford had left Caernarfon and was in Carlisle in October 1300; he remained occupied with the Scottish wars until the autumn of 1304 when building at Caernarfon resumed. Construction continued at a steady rate until 1330. Subsequent additions to Caernarfon were not major, and what remains of the castle is substantially from the Edwardian period. Despite the expense, much of what was planned for the castle was never carried out. The rears of the King's Gate (the entrance from the town) and the Queen's Gate (the entrance from the south-east) were left unfinished, and foundations in the castle's interior mark where buildings would have stood had work continued. ==Later history==