U.S. officials turned away a 17-year-old Palestinian incoming Harvard freshman last week after he was questioned about his friends’ social media posts, according to the Harvard Crimson.

The 17-year-old, a resident of Tyre, Lebanon, was deported about eight hours after arriving at Logan International Airport in Boston and said in a written statement obtained by the Crimson that immigration officials questioned him for hours and searched his phone and computer.

The teen, whom The Hill is not naming because he is a minor, said he was questioned on his religious practices and instructed to unlock his devices, according to the Crimson.

After about five hours, he said, an immigration official “called me into a room, and she started screaming at me. She said that she found people posting political points of view that oppose the US on my friend[s] list,” according to the Crimson.

“I responded that I have no business with such posts and that I didn’t like, [s]hare or comment on them and told her that I shouldn’t be held responsible for what others post … I have no single post on my timeline discussing politics,” he added.

The student’s visa was then canceled and he was told he would be deported, according to the newspaper.

In an email to the Crimson, U.S. Customs and Border Protection spokesperson Michael McCarthy said “Applicants must demonstrate they are admissible into the U.S. by overcoming ALL grounds of inadmissibility including health-related grounds, criminality, security reasons, public charge, labor certification, illegal entrants and immigration violations, documentation requirements, and miscellaneous grounds.”

“This individual was deemed inadmissible to the United States based on information discovered during the CBP inspection,” McCarthy added, according to the Crimson.

The Hill has reached out to the Department of Homeland Security for comment.

Harvard said the university is negotiating with immigration officials to resolve the matter before the Sept. 3 start of the fall semester.

Two Harvard graduate students were similarly blocked in 2017 under the Trump administration’s initial travel ban, although they were eventually allowed into the U.S.

“The University is working closely with the student’s family and appropriate authorities to resolve this matter so that he can join his classmates in the coming days,” university spokesperson Jonathan Swain told the Crimson.

The student says he is also in touch with AMIDEAST, the nonprofit that awarded him a scholarship to Harvard and that has agreed to provide legal assistance, according to the Crimson.

“Visa records are confidential under U.S. law; therefore, we cannot discuss the details of individual visa cases. Generally, visa applicants are continuously screened, both at the time of their application and afterwards, to ensure they remain eligible to travel to the United States,” a State Department official told The Hill.