Ismail Ajjawi was deported from the airport over his friend's social media posts.

A Palestinian student who was denied entry to the United States last month is now on campus at Harvard University and is expected to begin classes Tuesday, a Harvard official confirmed.

Ismail Ajjawi, a 17-year-old who earned a scholarship to Harvard while living in refugee camps in Lebanon, was allowed to enter the United States on Monday, his attorney Albert Mokhiber said.

"It's a classic sad tale with an exceptionally unique happy ending," Mokhiber said in a written statement in which he thanked the efforts of Harvard, the U.S. Embassy in Beirut, Amideast - the group that granted the scholarship - "and the outpouring of international media and popular support. On behalf of Ismail and his family, we thank you all."

Ajjawi told the Harvard Crimson last week that he was detained for hours and interrogated in the airport. After officials searched his phone and computer and asked questions about his religion and social media, his visa was revoked and he was sent back to Lebanon.

"After the 5 hours ended, she called me into a room, and she started screaming at me," Ajjawi wrote in a statement to the Crimson. "She said that she found people posting political points of view that oppose the US on my friend[s] list. 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."

Michael McCarthy, a spokesman for U.S. Customs and Border Protection, said in an email last week that the department is responsible for ensuring the safety and admissibility of the goods and people entering the United States. "This individual was deemed inadmissible to the United States based on information discovered during the CBP inspection," he wrote at the time.

A spokesman for U.S. Customs and Border Protection did not respond immediately to a request for comment Tuesday.

Ajjawi's family expressed appreciation for the efforts "of so many individuals and officials in Lebanon, Washington, Massachusetts and at Harvard that have made it possible for our son Ismail Ajjawi to begin his studies at Harvard with his class. The last ten days have been difficult and anxiety filled," they said in a written statement, "but we are most grateful for the thousands of messages of support and particularly the work of AMIDEAST." They expressed hope that Ajjawi "can now simply focus on settling into College and his important class work."

A coalition of student groups at Harvard, led by an immigrants' rights group, launched a petition demanding Ajjawi be allowed to enter. Nearly 8,000 people signed it within days.