A software development student from York who hacked into Facebook has been jailed for eight months.
Glenn Mangham, 26, had earlier admitted infiltrating the social networking website between April and May 2011.
Mangham, of Cornlands Road, York, had shown search engine Yahoo how it could improve security and said he wanted to do the same for Facebook.
Sentencing Mangham, Judge Alistair McCreath said his actions could have been "utterly disastrous" for Facebook.
Alison Saunders, from the Crown Prosecution Service, described the case as "the most extensive and flagrant incidence of social media hacking to be brought before British courts".
Prosecutor Sandip Patel rejected Mangham's claims, saying: "He acted with determination, undoubted ingenuity and it was sophisticated, it was calculating."
Facebook spent $200,000 (£126,400) dealing with Mangham's crime, which triggered a "concerted, time-consuming and costly investigation" by the FBI and British law enforcement, Mr Patel said.
The prosecutor told Southwark Crown Court in London how Mangham had "unlawfully accessed and hacked into the social media website Facebook and its computers in April to May last year from his bedroom in Yorkshire".
Mangham had ultimately stolen "invaluable" intellectual property, which he downloaded on to an external hard drive, said Mr Patel.
Facebook discovered the infiltration during a system check even though the defendant deleted his electronic footprint to cover his tracks.
Mr Mangham's defence lawyer Tom Ventham had said his client was an ethical hacker who had a "high moral stance" and Yahoo had "rewarded" him for pointing out its vulnerabilities previously.
He added that when Mangham was arrested he made "copious" admissions to police about what he had done.
Passing sentence, Judge Alistair McCreath told Mangham his actions were not harmless and had "real consequences and very serious potential consequences" for Facebook.
"You and others who are tempted to act as you did really must understand how serious this is," he said.
"The creation of that risk, the extent of that risk and the cost of putting it right mean at the end of it all I'm afraid a prison sentence is inevitable."
Mr McCreath said while he acknowledged that Mangham had never intended to pass on any of the information he had gathered, nor did he intend to make any money from it, his activities were "not just a bit of harmless experimentation".
"You accessed the very heart of the system of an international business of massive size, so this was not just fiddling about in the business records of some tiny business of no great importance," he said.
A spokesperson for Facebook said they "applauded" the work of the police and Crown Prosecution Service in this case, "which did not involve any compromise of personal user data".
They added: "We take any attempt to gain unauthorised access to our network very seriously, and we work closely with law enforcement authorities to ensure that offenders are brought to justice."