A student's plans to attend Harvard University were potentially cut short Friday when a U.S. Customs and Border Protection officer at Boston Logan International Airport turned him away.

The decision to reject Ismail Ajjawi's entrance into the U.S. was first reported by the Harvard Crimson student newspaper, which received a statement from Ajjawi, a 17-year-old Palestinian resident of Lebanon. The teen said a U.S. official asked him about his religious practices and searched his laptop and cellphone for five hours before questioning him about his friends' social media activity.

"After the 5 hours ended, she 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," Ajjawi wrote, according to the Crimson.

Get Breaking News Delivered to Your Inbox

Ajjawi told the paper he has "no single post on my timeline discussing politics."

"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," Ajjawi wrote, according to the Crimson.

Eight hours after Ajjawi arrived at the airport, just a few miles from the campus where he expected to attend college, he was sent back to Lebanon.

In a statement to CBS News, U.S. Customs and Border Protection (CBP) confirmed that Ajjawi was "deemed inadmissible" by an officer.

"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," the agency said.

A spokesperson for Harvard said the university still hopes Ajjawi will be attend classes this fall.

"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," the spokesperson said.

The spokesperson also noted that Harvard University President Lawrence Bacow wrote to Secretary of State Mike Pompeo on July 16 to express his "deep concern over growing uncertainty and anxiety around issues involving international students and scholars."