Begun in 1283 as part of Edward I's second Welsh campaign, the castle was part of Edward's "iron ring" of castles around Snowdonia, "a string of new castles to hem the prince in". Construction began in 1283, "within days of Edward's arrival". Like many of the castles in the area, Harlech was designed by Master James of St. George. The castle took seven years to build, and cost an estimated £8,190 to build..Following its completion, James was appointed Constable of Harlech Castle, a position he held for over three years.
All the royal castles of Edward's second Welsh campaign were sited "so that they could be kept supplied at all times". Harlech, "although it now appears landlocked, was not always so isolated". The sea used to come to the foot of the cliffs.
The castle is built to a concentric plan, with one line of defences enclosed by another. The outer walls are much shorter and thinner than the mighty inner walls, and have no towers defending them besides the small gatehouse. The inner ward is roughly square, with a large round tower at each corner. The domestic buildings, including the great hall, are built against the inside of the inner walls. Since the surrounding cliffs made it practically impossible to attack the castle except from the east, this side is faced by the imposing gatehouse. The gate is flanked by two massive "D-shaped" towers, the standard plan of the era, and defended by a series of doors, portcullises and murder-holes. Noteably, there are large windows on the inner face of the gatehouse, showing its second role as the premier domestic accommodation. The west wall of the inner ward also has large windows (as it forms one wall of the great hall), which would make it vulnerable were it not for the aforementioned cliffs.
The outer ditches at Harlech were "hacked through solid rock". In the height of construction, in 1286, the workforce was "546 general labourers... 115 quarriers, 30 blacksmiths, 22 carpenters and 227 stonemasons."
Harlech is also notable for an unusual feature: the "way from the sea". Edward's forces were often in danger from land-based attack, but he enjoyed total supremacy on water. Many of his castles included "sally ports" which allowed resupply from the sea, but Harlech's is far more elaborate. Here, a fortified stairway hugs the rock and runs almost 200 feet down to the foot of the cliffs, where (at the time of construction) the sea reached. Today, the sea has retreated several miles, making it more difficult to envisage the concept in its original setting. James of St. George's plan was a triumph; when the castle was besieged during Madoc ap Llywelyn's campaign, this stairway was used to supply the castle.
Like many of Edward's castles, Harlech was originally designed to work in tandem with city walls.
After the completion of the castle, Master James was made constable between 1290–1293, a high status job, that gave him time to work on Edward's castles that were also under construction.
In 1294, Madoc ap Llywelyn, cousin to Llywelyn ap Gruffydd, began an uprising against English rule that spread quickly through Wales. Several English-held towns were razed and Harlech (along with Criccieth Castle and Aberystwyth Castle) were besieged that winter. As noted above, the "Way to the Sea" helped the defenders survive until the siege was lifted the following spring.
In 1404, the castle fell to Owain Glyndŵr after a long siege when starvation reduced the determined and fearful garrison to just twenty-one men, becoming his residence and family home and military headquarters for four years. He held his second parliament in Harlech in August 1405. Four years later, after another long siege of eight months, Harlech Castle was retaken in 1409 by Prince Henry (later Henry V) and a force of 1000 men under *John Talbot the Earl of Shrewsbury, during which Edmund Mortimer starved to death and Glyndŵr's wife, Margaret Hanmer, two of his daughters and four grandchildren were captured, later to be imprisoned and die. The actual number of defenders is unknown but a story tells of 12 Welsh defenders.
In the Wars of the Roses in the first part of Edward IV of England's reign (1461–1470), Harlech was held by its Welsh constable Dafydd ap Ieuan as a Lancastrian stronghold. Following the Battle of Northampton, Margaret of Anjou and the infant Henry VII of England fled to Scotland via Harlech. Following the defeat of the Lancastrians at the Battle of Towton, Edward controlled the country and Harlech eventually became last major stronghold under their control. Sir Richard Tunstall arrived as a reinforcement to the Lancastrians in the latter half of the siege in 1465. In 1468 it was the last Lancastrian fortress to surrender; it was able to withstand the seven-year siege through its being provisioned from the sea. It is the longest known siege in the history of the British Isles. This famous siege inspired the song "Men of Harlech" according to tradition.
During the English Civil War the castle was the last royalist fortress to hold out against the Parliamentary forces. The surrender, on 16 March 1647, over a year after King Charles had himself been captured, marked the end of the first phase of the war. The parliamentarians **slighted the castle after its fall.
*Sir John Talbot fought against The Maid of Orleans
**...Removed the turrets from the towers thereby removing it's ability to resist attack. It was a common practice especially after the advent of canon.