An incoming Harvard University freshman who was deported to Lebanon last month over social media posts arrived at the Ivy League institution just in time for the start of class on Tuesday, his relatives said.

The family of Ismail B. Ajjawi said the 17-year-old Palestinian student arrived Monday in Cambridge after he was barred from entering the US at Boston Logan International Airport on Aug. 23 following a search of his phone and laptop by a Customs and Border Protection officer, the Harvard Crimson reported.

“The last 10 days have been difficult and anxiety filled, but we are most grateful for the thousands of messages of support and particularly the work of AMIDEAST,” Ajjawi’s family told the college newspaper, thanking the nonprofit group that awarded him a full scholarship. “We hope now that everyone can respect our and Ismail’s privacy and he can now simply focus on settling into college and his important class work.”

The teen has said he was questioned for hours by immigration officials about his friends’ social media posts and his religious practices in his native Lebanon before he was told his visa would be canceled. He was then put back on a flight home despite insisting he never made the “political posts” that opposed US policies, he told 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,” Ajjawi wrote in a statement. “I have no single post on my timeline discussing politics.”

A Customs and Border Protection spokesperson said officials had deemed Ajjawi “inadmissible” to the US but did not elaborate.

The US Embassy in Beirut reissued Ajjawi’s visa after reviewing his case, allowing him to arrive on campus just before the start of classes, according to AMIDEAST officials.

“Ismail arrived at Boston Logan International Airport this afternoon, was admitted, and is now in Cambridge,” the nonprofit group said in a statement. “In addition, we express our gratitude to the many voices in the media and the public at large, both in the United States and abroad, who recognized the injustice of what happened to Ismail and voiced their concerns in traditional media and on social media.”

More than 7,000 people signed a petition organized by several student groups at Harvard in support of Ajjawi, according to the Crimson.

An attorney for the teen, who plans to study chemical and physical biology at Harvard, said getting Ajjawi back on US soil to attend classes there on a full-ride scholarship is “one of the most rewarding” victories of his 35 years working in immigration law.

“It’s a classic sad tale with an exceptionally unique happy ending,” attorney Albert Mokhiber told the Boston Globe.