JERUSALEM — Israel’s Supreme Court ordered the government on Thursday to admit an American woman on her student visa, overruling the Interior Ministry, which pushed to deport her over a stint as an advocate for Palestinian rights while she was an undergraduate at the University of Florida.

Lara Alqasem, 22, had been held in a cell at Ben Gurion Airport for more than two weeks while she fought deportation. She will now be allowed to follow through on her plans to enroll in the law school at Hebrew University in Jerusalem, where she hopes to study for a master’s degree in human rights and transitional justice.

The Interior Ministry accused Ms. Alqasem, while she led a campus chapter of Students for Justice in Palestine, of actively supporting the Boycott, Divestment, and Sanctions movement that presses Israel to end the occupation of the West Bank. Pro-Israel advocates consider the movement anti-Semitic and bent on Israel’s destruction, not least because it promotes Palestinians’ right of return to land now in Israel.

The case put an uncomfortable spotlight on what has become an acrimonious debate over who should be allowed into the country and more broadly, the health of Israeli democracy. Ms. Alqasem’s supporters, and even some critics on the right, accused the government of an overzealous border policy and said it would do more damage to Israel’s image abroad than any student’s call for a boycott.