Robert's Rebellion

Robert's Rebellion was a civil war amongst the Great Houses of Westeros that took place approximately seventeen years before the series begins. It displaced the royal house Targaryen and saw most of its members wiped out, with only two survivors who fled into exile across the sea. House Baratheon became the new royal house after the war's conclusion.

History
Aerys Targaryen, the Second of His Name, was a King of Westeros and the last member of House Targaryen to sit the Iron Throne. Nicknamed the Mad King, his reign became increasingly erratic and murderous. A final round of blood-letting, unleashed when his son Prince Rhaegar kidnapped Lyanna Stark of Winterfell, saw the Seven Kingdoms rebel against his rule. Brandon Stark protested the abduction of his sister and demanded justice. Aerys had him arrested for treason and then offered to ransom him to his father Rickard Stark. Aerys summoned Rickon to court and when he arrived publicly executed both father and son.

In the books
In the Song of Ice and Fire novels, this civil war took place between sixteen and fourteen years before the beginning of the novels. It lasted almost two years and began when Prince Rhaegar Targaryen kidnapped Lyanna Stark.

When Lyanna's father and eldest brother protested this act to King Aerys II Targaryen, the Mad King had them both killed in front of the entire Royal Court. Aerys then called for the heads of Lyanna's betrothed, Robert Baratheon, and her second brother Eddard Stark, who were under the care of Jon Arryn. Lord Arryn raised his banners in rebellion against these unjust acts and sent Robert and Eddard back to their lands to rally their men.

House Tully joined Robert's side after Eddard and Jon married Catelyn and Lysa Tully, respectively, whilst House Tyrell and House Martell supported the Targaryens. While House Tully did support Robert, the always fractious lords of the Riverlands were heavily divided in the war, and many stayed loyal to the Targaryens. House Lannister sat out most of the war, only entering - on Robert's side - after Robert killed Rhaegar and his victory was a foregone conclusion. It is never stated which side House Greyjoy was on, but it is possible that they did not fight at all and remained neutral, saving their strength for their failed attempt to secede outright from the realm a few years later in the Greyjoy Rebellion.

The rebellion climaxed with the Battle of the Trident, when the rebel armies destroyed the royalist host and killed Prince Rhaegar. Lannister forces, apparently having decided to support the king, arrived at King's Landing to help defend the capital, but then turned on the Targaryens, brutally sacking the city and killing King Aerys II and Rhaegar's children. Aerys' other heirs, Viserys and Daenerys Targaryen, fled into exile across the sea. House Tyrell, whose main force had been held up in a lengthy siege at Storm's End, proclaimed loyalty to Robert soon after the sacking of King's Landing.

In the aftermath of the war it was discovered that Lyanna Stark had died, so Robert married Cersei Lannister in thanks for her father delivering him victory and to secure an alliance between the two houses.

Elia Martell's brutal murder by the Lannisters during the Sack of King's Landing earned them the lasting enmity of the Martells. As a result of Elia's unnecessary and easily avoidable murder, Dorne became a hotbed of pro-Targaryen sentiment and it took lengthy negotiations with Jon Arryn for them to swear fealty to Robert.

In the books the war is also called the War of the Usurper by Targaryen loyalists.