The Raid on Lannisport was one of the opening attacks of the Greyjoy Rebellion, taking place approximately nine years before the War of the Five Kings. The Lannister fleet, docked at Lannisport was destroyed in an attack carried out by Euron Greyjoy, brother of Balon Greyjoy, who had crowned himself King of the Iron Islands.
Jaime Lannister recalls Euron burning the Lannister fleet at Casterly Rock (actually it took place in Lannisport), the very act which started the Greyjoy Rebellion, when he meets with Cersei Lannister to propose to her and form an alliance. Jaime goes on to recount how he killed many Ironborn, which Euron is grateful of since the Iron Islands were "overcrowded" and how it led to Euron's exile which made him the "greatest captain of the fourteen seas," discomforting Jaime.
In the books
In the A Song of Ice and Fire novels, the attack on Lannisport was devised by Euron Greyjoy but carried out by Victarion, Lord Captain of the Iron Fleet; he personally flung the first torch onto Tywin's flagship. The destruction of the Lannister fleet (which consisted of about twenty to thirty ships) gave the Ironborn freedom to launch an attack against Seagard and raid the coastline.
In the fourth novel, Euron spreads rumors about his past deeds, taking the credit for destroying the Lannister fleet as if he performed that himself.