The Supreme Court on Thursday ruled that an American student accused of advocating boycotts of Israel can enter the country, putting an end to a weeks-long saga that drew scrutiny of an Israeli law allowing alleged anti-Israel activists to be barred from entry.

Lara Alqasem, 22, had been held at a facility at the airport for 15 days after arriving in Israel for a master’s program at the Hebrew University of Jerusalem. The state alleged that Alqasem, who headed the local chapter of the pro-boycott Students for Justice in Palestine group while she was a student at the University of Florida, currently supports the boycott, divestment, and sanctions (BDS) movement against Israel. It said she could fly back to the US at anytime, but detained her at the airport since she chose to battle the entry ban through the courts.

In court, Alqasem insisted that she has not participated in boycott activities for a year and a half, and promised not to engage in BDS in the future. State lawyers argued that Alqasem’s deletion of her social media aroused suspicion and that she remains a threat.

Get The Times of Israel's Daily Edition by email and never miss our top stories Free Sign Up

In accepting her appeal, the Supreme Court overturned a ruling by a lower court that upheld the ban on her entry under a 2017 law forbidding BDS activists from entering Israel.

Alqasem, whose father is Palestinian, was released shortly after the Supreme Court decision.

Justice Neal Hendel, one of three Supreme Court judges who heard the appeal, affirmed in the ruling that while the state has the authority to bar BDS activists from the country, the law was not applicable in Alqasem’s case.

“In this case, preventing the entry of the plaintiff does not advance the purpose of the law and it was even argued, for example, by the Hebrew University that it harms Israeli academia,” Hendel wrote.

“The fight against boycotts is fitting and vital, as are the actions taken by the State of Israel on the matter. However, the concrete action before us clearly deviates from the range of reasonableness and cannot be accepted,” he added.

The Supreme Court accepted that Alqasem had stopped her pro-boycott activity in April 2017, that she had subsequently studied the Holocaust, and that Hebrew University had given her a place on a post-graduate course.

“Since the petitioner’s actions do not sufficiently warrant banning her entry to Israel, the unavoidable impression is that her political opinions were the reason behind the cancellation of the visa that was granted to her,” it ruled. “If that is indeed the case, we are talking about a radical and dangerous step.”

One of the judges warned, however, that if Alqasem “returns to her old ways” and promoted a boycott while in Israel, she could face expulsion.

Alqasem’s lawyers praised the Supreme Court ruling and her “principled and brave stand” against the ban on her entry, calling it a “gross misapplication” of the anti-BDS law.

“The Supreme Court’s decision is a victory for free speech, academic freedom, and the rule of law. Israel has the right to control its borders, but that right does not give the Interior Ministry unchecked power to turn away anyone it deems unwanted,” attorneys Yotam Ben Hillel and Leora Bechor said in a statement.

“Lara has ensured that no one else should be denied the right to enter Israel based on sloppy Google searches and dossiers by shadowy smear groups,” they added, referring to the sources of the state’s argument that Alqasem supports the BDS movement.

“Lara’s case proves that thought-policing has no place in a democracy.”

Hebrew University, which joined Alqasem’s appeal, also welcomed the court’s decision.

“The Hebrew University of Jerusalem looks forward to welcoming our newest student, Lara Alqasem, as she begins her MA in Human Rights & Transitional Justice at our law school next week,” it said in a statement.

The Supreme Court ruling also was also welcomed by left-wing lawmakers and organizations, while right-wing politicians assailed it.

Interior Minister Aryeh Deri, whose ministry is tasked with enforcing the law, called the ruling a “disgrace.”

“Where is our national dignity? In the US would she also dare to act against the state and demand to remain and study there? I’ll examine ways to prevent the recurrence of a case like this,” he wrote on Twitter.

Thursday’s ruling was a blow to Strategic Affairs Gilad Erdan, whose ministry oversees anti-BDS efforts. He had rejected a promise from Alqasem not to take part in boycott activities while in Israel as insufficient and was the most vocal opponent of allowing her to enter the country.

AP contributed to this report.