Liberation of Harrenhal

"The Lannisters have been running from us since Oxcross. I'd love a fight. The men would love a fight. And I don't think we're going to get one."

- Robb Stark

The Liberation of Harrenhal is an aborted military engagement in the War of the Five Kings.

Prelude
After the Battle of Golden Tooth and the Battle at the Mummer's Ford, Lannister armies quickly conquer all of the Riverlands south of the Red Fork of the Trident. Lady Shella Whent of Harrenhal possesses too few troops to adequately defend the castle, so she simply yields the castle to Tywin Lannister.

However, after Ser Jaime Lannister's host is defeated at the Battle of the Whispering Wood, Lord Tywin retreats the remaining Lannister army under his command back to Harrenhal to regroup, while Ser Gregor Clegane "the Mountain" leads out 500 riders to burn out all of the villages in the Riverlands between the Red Fork and Gods Eye lake, to deprive the Starks of resources should they attempt to follow Tywin's army.

Riverrun, besieged by Lannister forces, is liberated in the Battle of the Camps, while the occupations of Raventree Hall and Stone Hedge are later both put to an end by Greatjon Umber.

While the Lannister bannermen are expelled from the halls of the Riverlords, Robb Stark mounts an invasion of the Westerlands, in an attempt to lure Tywin Lannister away from Harrenhal and leave King's Landing open for an attack. Robb's army wins a great victory at the Battle of Oxcross, which leaves him free to sack and pillage the northern Westerlands.

Nevertheless, Lord Tywin doesn't take the bait and instead heads east to King's Landing to repel Stannis Baratheon in the Battle of the Blackwater. Robb's invasion of the Westerlands had resulted in no long-term strategic gains, and worse, the Lannisters had gained massive reinforcements in their new alliance with House Tyrell. Harrenhal is left under the command of Ser Gregor.

The Starks seize Harrenhal
With the morale of his army starting to wane without a major victory in months, and the release of Jaime Lannister by Catelyn Stark herself, King Robb decides to withdraw from the Westerlands, and challenge the Lannisters head-on, in the hope that another victory would regain lost morale. Robb chooses to march with his army against Harrenhal, the heart of Lannister presence in the Riverlands.

However, Robb does not find the decisive victory he was hoping for: the Mountain has withdrawn and not even bothered to waste any men on a token defense of the castle. The Northmen are further demoralized to find the courtyards are choked with the bodies of two hundred Northern and Riverlands prisoners of war put to the sword before they left.

Aftermath
The Mountain's forces marched west and seized Stone Mill as a new base from which to ravage the Riverlands. Edmure Tully leads an army from Riverrun to successfully engage and defeat them. Unfortunately, Robb's plan had been to surround and destroy the Mountain's forces in detail using overwhelming superiority of numbers. By attacking immediately, Edmure allowed the Mountain to escape west towards Casterly Rock, losing the Starks and their allies a valuable opportunity to destroy a significant enemy commander and his forces.

In the books
The subplot involving Harrenhal in the A Song of Ice and Fire novels is heavily condensed in the TV series. In the books, Robb splits his army in two after leaving the Twins: he personally leads their cavalry west to relieve Jaime Lannister's siege of Riverrun (in the Battle of the Whispering Wood), while he gives Roose Bolton command of their infantry, and sends him by the east bank of the Trident to lure away Tywin Lannister in the Battle of the Green Fork. The TV series hadn't even introduced Roose Bolton yet, and simplified the storylines so the narrative wasn't frequently jumping between separate Northern armies. Whatever the case, in the TV series, Robb Stark sends only a feint of 2,000 men to Green Fork, who are completely wiped out in the subsequent battle. In contrast, in the books the eastern half of the Northern army, under the command of Roose Bolton, puts up only a token defense and then retreats from the battle in good order once the fight is clearly lost. The entire point had only been to lure Tywin far enough away from Riverrun that he couldn't reach it in time to support Jaime's army. However, the other half of the Stark army under Roose Bolton continues to operate on the eastern front of the war in the Riverlands (along the Kingsroad and crossings of the Trident), using the Twins as headquarters. After Tywin leaves Harrenhal with most of his army, the eastern half of the Northern army under Roose Bolton's command captures Harrenhal after striking a deal with the Brave Companions, mercenaries hired by Tywin. Robb himself never arrives at Harrenhal.

The TV series condenses this so that instead of having two branches of the Northern army, one in the Westerlands and one around the Kingsroad in the east which later takes Harrenhal, the entire Northern army stays as a large formation that splits after the liberation of Riverrun in the Battle of the Camps, with one host invading the Westerlands under Robb's command, and another led by Greatjon Umber tasked with liberating the central Riverlands - Raventree Hall and Stone Hedge. These two hosts then rejoin to subsequently capture Harrenhal, in the eastern Riverlands. In both versions, of course, the local forces of the Riverlords are also fighting Tywin's forces throughout the Riverlands, and holding the line of the Red Fork.

Moreover, Arya Stark herself actually plays a vital role in the battle in the books. Jaqen H'ghar doesn't help Arya herself escape, instead he helps her stage an uprising within the castle by freeing all of the 100 Northern prisoners held by the garrison led by Ser Amory Lorch. Arya, Jaqen, Rorge and Biter overpower the Lannister guards in charge of the prisoners, by splashing them with boiling hot soup from the kitchens where she was forced to work - an event known as "Weasel soup" after Arya's alias. At the same time, the Brave Companions turn on their employers and slaughter many Lannister soldiers in their beds. As it turned out, their commander Vargo Hoat had not long before struck a deal with Roose Bolton to betray the garrison when he attacked, though the prisoner uprising led them to strike earlier. By the time Roose Bolton army arrives at Harrenhal, all of the Lannister garrison is dead, except for Ser Amory Lorch who is fed to a bear. A much more ruthless commander than Robb, Bolton then has several of those who collaborated with the occupation put to death, and their heads mounted on spikes. This bothers Arya considerably, as many of them were servants of old lady Shella Whent who were forced into serving the Lannisters. Arya becomes Bolton's cupbearer but remains quiet about her identity, having become painfully aware of how valuable a political hostage she would be to desperate men on both sides of the war (i.e. after the betrayals that got her father killed, Arya fears that some Northern soldiers might betray her and hand her over to the Lannisters in exchange for a large reward). Arya eventually decides that she will only be safe if she finds her brother and mother face to face, so she slips out of Harrenhal in search of them once again along with Gendry and Hot Pie. In the process she kills a Bolton soldier using the feint that, in the series, she employs to murder the Frey soldiers that mock her mother's death.