A California-based hacker has pleaded guilty to launching a Valentine's Day 2007 computer attack that nearly knocked an antiphishing website offline.

Gregory King, 21, pleaded guilty on Tuesday in federal court to two counts of "transmitting code to cause damage to a protected computer", for launching distributed denial of service (DDOS) attacks against the Castlecops antiphishing website and Killanet, an online forum for gamers and graphic designers.

He was arrested on October 1 as part of the US Federal Bureau of Investigation's Operation Bot Roast. As agents knocked on his door, King stashed his laptop computer in his backyard, but it was eventually recovered, according to the US Department of Justice (DoJ).

Killanet was attacked between 2004 and 2006 by King's botnet of about 7,000 hacked computers, the DoJ said.

Castlecops said that its attack reached a peak strength of 969Mbps. If the volunteer-run organisation had been charged for all that bandwidth, it would have had to close shop, the group said.

Castlecops collects information on phishing attacks and works with law enforcement to thwart the attacks.

King's plea agreement calls for a two-year prison sentence. He is set to be sentenced on September 3 by United States District Judge Lawrence Karlton.