A Palestinian Harvard student claims that he has been denied entry into the US because his friends had posted anti-American statements on social media.

Ismail Ajjawi, 17, who is due to begin his studies at the prestigious university next Tuesday, said he was detained when he arrived at Boston's Logan International Airport on Friday night.

Mr Ajjawai told the Harvard Crimson, the student newspaper, that immigration officers subjected him to hours of questioning and demanded access to his phone and computer.

Mr Ajjawai, who lives in Lebanon, said he was asked about his religious beliefs and practices before officers trawled through his technology devices.

The teenager said that after five hours an officer called him into a room and “started screaming" at him. "She said that she found people posting political points of view that oppose the US on my friend[s] list,” he said.

Mr Ajjawi said he stressed to the officer that he had not made any political posts himself and that he should not be held responsible for others’ posts.

“I have no single post on my timeline discussing politics,” he added.

However he claimed that the officer cancelled his visa and informed him that he would be deported back to Lebanon.