As one of the main military leaders on the border to Scotland, Harclay became frustrated with Edward II's inactivity, particularly the humiliating English defeat at the Battle of Old Byland on 14 October 1322, which made it clear that the war could not be won. Harclay initiated negotiations with the Scots on his own accord, and on 3 January 1323, he signed a peace treaty with Robert the Bruce. The act was without royal sanction, and amounted to treason. The king issued an arrest order for the earl, and on 25 February Harclay was taken into the king's custody. He was arraigned before royal justices on 3 March, denied a hearing, and executed the same day. He was hanged, drawn and quartered, and the various parts of his body displayed in different parts of the country. Only after five years was he allowed a proper burial, but the conviction for treason was never annulled.
The family name of Harclay derives from Hartley in Westmorland. Though relatively little is known about his early years, Andrew Harclay was probably the eldest son of Sir Michael Harclay and Joan, daughter of the Yorkshire landowner William Fitzjohn. His younger brother was the theologian Henry Harclay, a Chancellor of the University of Oxford. Michael Harclay was a retainer of the Clifford family, and served as sheriff of Cumberland from 1285 to 1296. The first documented appearance of Andrew Harclay was at a Westmorland eyre in 1292, at which point it must be assumed that he was at least twenty-one years old, and therefore born in the early 1270s.
His military career can be traced back as far as 1304 when he took part in a campaign in the Scottish Wars. In 1309, he received a royal order to assist Robert de Clifford in the defence of the Marches against Scotland. His standing in local affairs was further advanced in 1311, when he was appointed sheriff of Cumberland, like his father had been before him. This was followed by his election as Knight of the Shire in 1312, and in December 1313, he distinguished himself as the leader of the defence against a Scottish invasion. He received further acclaim in the summer of 1315, when he successfully defended Carlisle Castle against a siege by Robert the Bruce. For this he was awarded a gift of 1000 marks from the king.
Late in 1315 or in 1316, Harclay was taken captive by the Scots, who demanded 2000 marks in ransom. His meteoric rise over the previous years had made him some enemies in local society, who now took the opportunity to spread slanderous rumours about him at court. The king nevertheless helped raise the necessary money to secure Harclay's freedom, but for the next few years he seems to have been out of royal favour. It was not until 1319 that he once more was appointed sheriff, and at the same time made keeper of Carlisle and Cockermouth castles, and Warden of the West Marches. In 1321 he also received a personal summons to parliament.
Harclay's most prominent achievement came with the Battle of Boroughbridge in 1322. The battle was the culmination of an ongoing struggle between King Edward II and his most powerful earl, Thomas of Lancaster. The conflict stemmed from disagreement over the handling of the war with Scotland; Lancaster, and many others, found the king's war effort lacking. After failing to incite an insurrection against the king, Lancaster was in March 1322 fleeing northwards from the royal army. Meanwhile, Harclay, as sheriff of Cumberland, was ordered by the king to levy the forces of the northern counties of Cumberland and Westmorland, and move south. His orders were to meet up with the royal army, but while stopping at the town of Ripon in Yorkshire, he received intelligence that Lancaster would arrive at nearby Boroughbridge the next day. Harclay decided to take the initiative, and occupy the bridge that would prevent Lancaster's passage across the River Ure.
Lancaster's army arrived at Boroughbridge on 16 March. The rebels were greatly outnumbered; while Harclay commanded around 4000 men, Lancaster only had some 700 knights and men-at-arms, with followers, in his service. In addition to this, the loyalist forces were highly trained and experienced from the Scottish Wars. Harclay used tactics the English had learned from the Scots in these wars. The Lanercost Chronicle describes how Harclay employed the Scottish schiltron – a compact formation of infantrymen with pikes or spears, highly effective against Lancaster's cavalry-heavy forces. According to The Brut, Lancaster tried to persuade Harclay to join his side, in return for great rewards in land. Harclay had previously been a supporter of Lancaster, possibly also the earl's retainer; in 1318, a general royal pardon for Lancaster and his adherents contained Harclay's name. On this occasion, however, Harlay decided to remain loyal to the king, and turned down the earl's offer.
The engagement was short and one-sided. Lancaster's plan was to charge across a ford in the river, while the Earl of Hereford – one of the few magnates who had remained loyal to Lancaster – crossed the bridge. Hereford was killed on the bridge, his companion Roger de Clifford, 2nd Baron de Clifford was badly wounded, and this advance failed. Lancaster, meanwhile, came under such heavy archery fire that he had to call off his attack. Defections during the night, combined with royal reinforcements, forced him to surrender the next day, and on 22 March he was executed. The king was greatly pleased with Harclay's effort, and rewarded him lavishly. On 25 March, Harclay was created Earl of Carlisle, and given land worth 1000 marks a year. On 15 September, he was also made chief Warden of the Marches.
On 14 October 1322, the English army was routed by the Scots, under the command of Robert the Bruce, at the Battle of Old Byland in Yorkshire. The English commander, John of Brittany, Earl of Richmond, was taken prisoner, while the king himself barely escaped capture. It was the worst defeat the English had suffered in the wars since the Battle of Bannockburn in 1314. Harclay had received a summons to join the royal army, but had not been able to bring his troops south in time to come to the king's rescue. The event convinced him that the war against Scotland could not be won under the leadership of the present king. Instead he entered into direct negotiations with the Scots, without the king's sanction. On 3 January 1323, he signed a peace treaty with Robert the Bruce at Lochmaben.
The treaty recognised Scotland as an independent kingdom. It stipulated that Robert was to pay 40,000 marks to the English, and that Edward should be allowed to choose a wife from his own family for Robert's heir. Implied in the text, however, was an alliance between Robert and Harclay to use force against Edward, if necessary, to implement the terms of the treaty. It seems unlikely that Harclay expected royal clemency for his actions. More likely he contemplated a defection to the side of Robert the Bruce; rumour had it he even planned marrying one of Bruce's daughters. It is nevertheless likely that his action grew out of genuine concern with the northern situation, and was a desperate attempt to make the best out of a difficult situation.
Though historians have generally shown understanding for Harclay's actions, it is nevertheless common to refer to the event as "Harclay's treason". In the words of Maurice Keen: "To make a truce, or to indeed to give safe-conducts or make any agreement with the king's enemies without proper grant of powers, again constituted lèse majesté and can be found defined as such in other military cases". Harclay had received such powers in February 1322, but he was considered to have overstepped his prerogative by the 1323 treaty. It is also possible that Edward held a grudge against Harclay for the latter's failure to come to the rescue at Byland, and that this was behind the king's later, severe reaction. There is, however, no evidence that Harclay received the royal letter in time to arrive at the battlefield any earlier than he did.
When Edward found out about Harclay's treason, he issued an order for the earl's arrest. As Harclay attempted to garner support for his cause, the king began to fortify the northern castles. The stalemate lasted until 25 February, when Sir Anthony Lucy arrested the earl at Carlisle Castle. Lucy, who acted with only a small force, was clearly trusted by Harclay, so the arrest must have been conducted as a surprise manoeuvre. The enmity between Lucy and Harclay could stem from a dispute over the honour of Papcastle. In 1322, Harclay had also briefly disseised Lucy of his lands after the 1322 rebellion, even though Lucy had taken no part in that event.
On 3 March, Harclay was arraigned before a royal justice in Carlisle, but was denied a proper hearing. He was brought forward apparelled in his robes of estate as a knight and earl. His spurs of knighthood were hewed off, and his sword was broken over his head. He was stripped of his robes, and proclaimed to be no knight, but a knave. He was then convicted as a traitor, and condemned to be hanged, drawn and quartered. He behaved with dignity at his execution, where he maintained that he had acted as he did out of concern for the best interest of the country. After his death, his head was taken to the king at Knaresborough in Yorkshire, before it was hung up on London Bridge. The four parts of his body were dispersed around the country, and displayed in Carlisle, Newcastle, Bristol, and Dover.
Harclay's head was on display in London for five years before it was taken down. His sister petitioned the king to return the various parts of the body for a Christian burial, and in 1328 her request was granted. Further clemencies were not awarded. In the reign of Edward III, Harclay's nephew Henry petitioned to have the charge of treason annulled, but the petition was ignored. As for the peace treaty, the wisdom of Harclay's policy was vindicated after his death. Edward II's inability to win the war against the Scots, combined with his refusal to give up his claim on the Scottish crown, proved untenable in the end. Furthermore, it was Harclay's military skills and well-organised forces that gave what little protection the northern borders had over the previous years. Less than three months after Harclay's execution, Edward agreed on a thirteen-year truce with Scotland.
Harclay's unauthorised negotiations with Robert the Bruce are dealt with in some significant detail in The Price of the King's Peace, the third volume of Nigel Tranter's Bruce trilogy, where he is called "Andrew Harcla".