A Palestinian student who was denied entry to the US just days before he was scheduled to start classes at Harvard has been admitted to the country.

The family of Ismail Ajjawi said in a statement on Monday that it appreciated the efforts of all of the people who helped him.

Ajjawi was denied entry on 23 August after spending eight hours in Boston Logan international airport. He had been living in Lebanon.

The 17-year-old freshman said the denial had to do with politically oriented social media posts by friends.

A US Customs and Border Protection spokesman, Michael McCarthy, said only that the decision to cancel Ajjawi’s visa was based on information discovered during an inspection.

A non-profit that awarded Ajjawi a scholarship said the US embassy in Beirut reviewed his case and reissued his visa.