Capture of Riverrun

"Your great-uncle, Brynden, the Blackfish, has gathered what remains of the Tully forces and retaken Riverrun"

- Petyr Baelish to Sansa Stark.

The Taking of Riverrun is a battle during the War of the Five Kings. It is mentioned in the episode "The Door", and sees the retaking of the castle Riverrun by House Tully from the armies of House Frey.

Prelude
After the Red Wedding, House Frey are elevated to the Great House of the Riverlands as Lords Paramount of the Trident and Lords of Riverrun. However, Ser Brynden Tully, known as the Blackfish, escapes the Red Wedding. Lord Walder Frey orders a manhunt for the only Tully on the loose, yet it proves to be unsuccessful. As a consequence of the obliteration of the Stark and Tully armies at the Red Wedding, the Freys occupy Riverrun without opposition.

Events
The Blackfish eventually reforms the remaining loyal garrisons, and attacks and retakes Riverrun from the armies of House Frey. Lothar Frey and Walder Rivers survive the conflict and return to the Twins.

Aftermath
"As long as I'm standing, the war is not over!"

- Brynden Tully to Jaime Lannister

Following the Blackfish's reconquest of Riverrun, several river lords, such as the Mallisters and Blackwoods, rise in rebellion. This, combined with the incessant harassment from the Brotherhood without Banners, who are rising the smallfolk in rebellion and raiding Frey supply trains and camps, weakens the Frey's hold on the Riverlands to the point they don't have enough forces to take back the castle. However, Walder Frey plans to take the imprisoned Lord Edmure Tully to Riverrun and use him as leverage against the Blackfish.

The retaking of Riverrun has consequences all across the realm: When Sansa Stark learns of the Blackfish's victory from Petyr Baelish, she sends Brienne of Tarth on a mission to enlist the help of the Tully forces to her own cause of retaking Winterfell from Ramsay Bolton. Later, King Tommen relieves Ser Jaime Lannister of his Kingsguard duties for marching against the Faith and sends him to deal with the Blackfish and retake the castle for the Freys. This sets stage for another open conflict between the Tullys and the Lannisters.

In the books
In the A Song of Ice and Fire novels, Brynden Tully is not present at the Red Wedding, so he continues to hold Riverrun after the massacre, of orders from Robb Stark and in defiance of the Freys and the Iron Throne. In fact, Riverrun is besieged by House Lannister and Frey, in an effort to remove the final vestiges of resistance in the riverlands and install Ser Emmon Frey as the new Lord of Riverrun, as the terms of the alliance between the Freys and Lannisters dictate.

Brynden Tully anticipates the siege. He gathers all the foodstuffs and goods he can within the castle, expels all the unnecessary mouths, and prepares for a long siege. Ryman commands a large and disorderly Frey encampment north of the Tumblestone. South of the Red Fork are Lord Emmon, Ser Forley Prester with other westermen, and rivermen who knelt to the Iron Throne after the Red Wedding. Daven commands House Lannister's camp between the Tumblestone and the Red Fork. To prevent Riverrun's defenders from escaping, Ser Manfryd Yew and Ser Raynard Ruttiger command a boom across the Red Fork east of the castle.

Later, Ser Jaime Lannister leaves King's Landing at Cersei's command and still a Kingsguard, with near one thousand reinforcements for the Freys, though in the way to Riverrun he leaves some of them behind, such as the Holy Hundred at Harrenhal and Ser Ronnet Connington with some of the Mountain's men at Maidenpool.