Israel’s decision on Thursday to bar two American Democratic congresswomen, Representatives Rashida Tlaib of Michigan and Ilhan Omar of Minnesota, from visiting the country rests on a law passed just two years ago. Aimed at Israel’s critics, the law has been used to deny entry to outspoken foreign supporters of a global movement to boycott the country, which has significant support in Europe as well as the United States.

The announcement came hours after President Trump encouraged Israel to deny entry to the congresswomen, an extraordinary attempt to influence an ally and punish his domestic political opponents.

On Friday, Israel said that it would allow Ms. Tlaib to enter the country to visit her grandmother, who lives in the occupied West Bank, but she declined on principle, saying that a trip “under these oppressive conditions stands against everything I believe in.”

Here’s some background on the Israeli law used on Thursday to bar the two congresswomen and how it has been implemented.