– Israel announced Thursday it will block Minnesota U.S. Rep. Ilhan Omar and a Democratic colleague from an upcoming congressional visit after President Donald Trump tweeted that they should be barred.

Prime Minister Benjamin Netanyahu, who previously had approved Omar and Rep. Rashida Tlaib’s visit planned for this weekend, reversed himself hours after Trump’s tweet. He cited Omar and Tlaib’s vote in the House against a resolution that condemned a boycott movement against Israel.

“Congresswomen Tlaib and Omar are leading activists in promoting the legislation of boycotts against Israel in the American Congress,” Netanyahu’s statement said. He said their itinerary “revealed that they planned a visit whose sole objective is to strengthen the boycott against us and deny Israel’s legitimacy.”

Trump tweeted ahead of Netanyahu’s statement that, “It would show great weakness if Israel allowed Rep. Omar and Rep. Tlaib to visit.”

On Friday, Tlaib said she won't visit her relatives in the West Bank after Israel reversed itself earlier in the day by issuing a permit on humanitarian grounds. She cited "oppressive conditions meant to humiliate me."

Omar declined to comment Thursday when approached by a reporter at Minneapolis City Hall. Her office later released a statement calling Netanyahu’s decision an “affront,” and criticizing Netanyahu and Trump.

“Sadly, this is not a surprise given the public positions of Prime Minister Netanyahu, who has consistently resisted peace efforts, restricted the freedom of movement of Palestinians, limited public knowledge of the brutal realities of the occupation and aligned himself with Islamophobes like Donald Trump,” Omar said in the statement.

The Israeli government’s decision and the unusual presidential effort to influence it came under wide criticism from Omar’s friends and foes alike, including from Muslim civil rights groups and supporters of Israel.

Omar and Tlaib, from Michigan, are the first two Muslim women in Congress. Tlaib is the daughter of Palestinian immigrants. She and Omar support the global Boycott, Divestment and Sanctions (BDS) movement, which aims to pressure Israel economically to improve its treatment of Palestinians.

In his first tweet on the matter Thursday, Trump wrote of Omar and Tlaib: “They hate Israel & all Jewish people, & there is nothing that can be said or done to change their minds.” He tweeted again after the decision was announced: “Representatives Omar and Tlaib are the face of the Democrat Party, and they HATE Israel!”

Tlaib and Omar, both elected to Congress for the first time last year, were early supporters of impeaching Trump among House Democrats. Tlaib got attention on the day she was sworn in at a speech where she used an expletive for emphasis in referring to the president and impeachment.

Trump and Omar have traded highly critical tweets for months. More recently, the Republican president has repeatedly attacked Omar, Tlaib and two other Democratic women of color in harsh terms, suggesting they should “go back and help fix the totally broken and crime infested places from which they came.”

Omar and Tlaib had been scheduled to arrive in Israel this weekend and visit the Israeli-occupied West Bank. They have been critical of Israel’s influence in Washington, and were among a very small group of House members who voted against a House resolution in July condemning the BDS movement.

David Friedman, the U.S. ambassador to Israel, described the BDS movement in a statement as “no less than economic warfare,” and noted that Israeli law “bars entry of BDS activists under the circumstances present here.”

The congressional resolution opposed the BDS movement “and other efforts targeting Israel.” It urged both sides to return to the negotiating table and supported “a solution resulting in the state of Israel existing alongside a democratic Palestinian state.”

That measure passed 398-17. Another Minnesota Democrat, Rep. Betty McCollum, was also among those who voted against it. McCollum is a longtime critic of Israel’s treatment of Palestinians and has visited the country as a member of Congress.

“Denying entry into Israel not only limits our ability to learn from Israelis, but also to enter the Palestinian territories,” Omar said in her statement. She said as a member of the House Foreign Affairs Committee she is entitled to “conduct oversight of foreign aid from the United States of America and to legislate on human rights practices around the world.”

Earlier this year, Omar angered Jewish groups and Jewish politicians of both parties with several tweets and a public remark that were criticized as anti-Semitic. She apologized, and worked to mend fences with Jewish groups nationally and in Minnesota, and with Jewish colleagues in the House Democratic Caucus.

“I am appalled by Israel’s decision to bar entry to sitting members of the United States Congress,” U.S. Rep. Dean Phillips said in a prepared statement. The Minnesota Democrat, who is Jewish, said Israel’s action “sets a damaging precedent for a free and democratic nation and our most important ally in the region.”

Other prominent Democrats weighed in to criticize Trump and Israel, including Minneapolis Mayor Jacob Frey, who’s also Jewish.

The Jewish Community Relations Council of Minnesota and the Dakotas, which was critical of Omar’s early statements about Israel and her support for the BDS movement, was nonetheless critical of Israel’s decision.

“We believe allowing the two Representatives to visit was consistent with their status as members of Congress, and Israel’s democratic character,” the group said in a statement.

The Simon Wiesenthal Center, a global Jewish human rights group whose founder spoke at Trump’s inauguration, released a statement calling Omar and Tlaib “unapologetic anti-Semites” and said they “could have joined dozens of their colleagues who recently visited Israeli and Palestinian territories.” But, the organization said, “the first instinct of Israeli officials to let them into the country was [the] right one.”

Congressional leaders had called for Omar and Tlaib’s trip to go forward, and House Republican Leader Kevin McCarthy backed the idea in a news conference in Israel with House Democratic Leader Steny Hoyer.

“Israel’s denial of entry to Congresswomen Tlaib and Omar is a sign of weakness, and beneath the dignity of the great state of Israel,” Speaker Nancy Pelosi said in a statement from her office.

The Associated Press contributed to this story.