A STUDENT who hacked into Facebook in the "most grave" case of social media hacking to come before a British court has been jailed for eight months.

Glenn Mangham, 26, admitted infiltrating the site from his his parents' house in York between April and May last year.

His actions were said to have risked destroying "the whole enterprise" and sparked fears in the US of industrial espionage.

Mangham, a software development student, had previously shown search engine Yahoo how to improve its security and said he wanted to do the same for Facebook.

However, prosecutor Sandip Patel rejected his 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 detectives.

"He said he wanted a mini project and chose Facebook because of its high-profile presence," Mr Patel said.

"The prosecution does not accept that the defendant's actions were anything other than malicious."

He told Southwark Crown Court in London how Mangham "unlawfully accessed and hacked into the social media site and its computers in April to May last year from his bedroom in North Yorkshire" and had ultimately stolen "invaluable" intellectual property, which he downloaded on to an external hard drive.

He added: "This represents the most extensive and grave incident of social media hacking to be brought before the British courts."

Passing sentence, Judge Alistair McCreath told Mangham his actions were not harmless and had "real and very serious potential consequences" which could have been "disastrous".

"You and others who are tempted to act as you did really must understand how serious this is," he said.

Tony Ventham, defending Mangham, said he was an "ethical hacker" who had described himself as a security consultant.

He went on: "It was common currency in the community of computer nerds or geeks ... where there was this interesting relationship between companies and people who point out vulnerabilities."

He had not tried to sell any of the information he obtained or pass it on, Mr Ventham stressed.

The court heard he was of good character but showed strong indications of Asperger syndrome, and may have been trying to prove himself to his father.

A Facebook spokesman said: "We applaud the efforts of the Met Police and the CPS in this case, which did not involve any compromise of personal data."