File picture: Thibault Camus/AP

London - A Cambridge University academic who harvested data on millions of Facebook users said he has been made a scapegoat by the social network and a UK-based political consultancy that is accused of trying to sway public opinion for Donald Trump.

Facebook has been rocked this week by a whistleblower who said that Cambridge Analytica, a UK-based political firm hired by Trump for the 2016 campaign, had improperly accessed information on 50 million Facebook users.

The company has lost nearly $50 billion of its stock market value over the last two days over fears that its dealings with Cambridge Analytica might damage its reputation, deter advertisers and invite tougher regulation.

Facebook has said the data was harvested by Aleksandr Kogan, a psychology academic, who created an app on the platform that was downloaded by 270 000 people. It says he then violated its policies by passing the data to Cambridge Analytica.

Read: #CambridgeAnalytica's dirty tricks go beyond data harvesting

A new threat to Facebook’s reputation

"The events of the past week have been a total shell shock," Kogan told the BBC. "My view is that I'm being basically used as a scapegoat by both Facebook and Cambridge Analytica when... we thought we were doing something that was really normal.

"We were assured by Cambridge Analytica that everything was perfectly legal and within the terms of service."

Alexander Nix, the head of Cambridge Analytica who was suspended on Tuesday, said in a secretly recorded video that his company had played a decisive role in Trump's election victory.

But Kogan said the accuracy of the dataset had been "exaggerated" by Cambridge Analytica, and that the information was more likely to hurt Trump's campaign.