US congresswoman Rashida Tlaib has rejected an offer from Israel to visit family in the occupied West Bank on the condition she does not express certain political views.

“I have decided that visiting my grandmother under these oppressive conditions stands against everything I believe in – fighting against racism, oppression & injustice,” she wrote on Twitter.

In a controversial move that drew strong rebukes from US politicians and even the most powerful US pro-Israel lobby group, Israel said on Thursday it would block Tlaib and another Democratic lawmaker, Ilhan Omar, from entering the country for a planned congressional trip to the West Bank and Jerusalem.

Israel then said it would consider a “humanitarian request” for Tlaib to visit her relatives “on the condition that she pledges not to act to promote boycotts against Israel”.

On Friday night President Trump criticized Tlaib for “obnoxiously” turning down Israel’s conditional offer.

Rep. Tlaib wrote a letter to Israeli officials desperately wanting to visit her grandmother. Permission was quickly granted, whereupon Tlaib obnoxiously turned the approval down, a complete setup. The only real winner here is Tlaib’s grandmother. She doesn’t have to see her now! — Donald J. Trump (@realDonaldTrump) August 16, 2019

According to Israel’s interior ministry, Tlaib herself made a plea later on Thursday for a personal visit, which was approved on Friday morning.

“I would like to request admittance to Israel in order to visit my relatives, and specifically my grandmother, who is in her 90s and lives in Beit Ur al-Fouqa,” the letter, shared by the ministry and apparently signed by Tlaib, said.

In a highly unusual move for a US politician to make, she promised not to express certain views on the Palestinian issue during her trip.

“This could be my last opportunity to see her. I will respect any restrictions and will not promote boycotts against Israel during my visit,” it added.

Tlaib, born in and representing Michigan, is of Palestinian descent. She would have to pass through Israeli security to access the village.

The congresswoman has not referred publicly to the letter and it is not clear if or why she changed her mind. However, several prominent pro-Palestinian figures have said that a visit with curbs of free speech would be a capitulation to Israel.

“What is truly upsetting is that Rashida Tlaib fell in this trap and accepted to demean herself and grovel,” said Nour Odeh, a former spokeswoman for the Palestinian Authority.

Thursday’s barring came shortly after the US president, Donald Trump, publicly urged Israel to block his political opponents, who he has recently attacked with racist slurs. “They are a disgrace!” he wrote on Twitter.

After she was banned, Tlaib posted a photo on Twitter of her grandmother and said Israel’s decision was “a sign of weakness [because] the truth of what is happening to Palestinians is frightening”.

This woman right here is my sity. She deserves to live in peace & with human dignity. I am who I am because of her. The decision by Israel to bar her granddaughter, a U.S. Congresswoman, is a sign of weakness b/c the truth of what is happening to Palestinians is frightening. pic.twitter.com/GGcFLiH9N3 — Rashida Tlaib (@RashidaTlaib) August 15, 2019

Israel said it decided to block the two freshmen politicians for their support of the boycott, divestment and sanctions (BDS) movement.

To outcry from rights groups who say it tramples free speech, Israel’s parliament, the Knesset, passed a law in 2017 allowing the government to deport people who support a boycott of Israel or Jewish settlements in the occupied West Bank.

It has since used the law against critics, activists and human rights groups.

Omar and Tlaib, the first Muslim women to serve in Congress, have openly criticised Israel’s treatment of Palestinians.

Both women have said they support the use of boycotts to pressure governments, including Israel’s, on rights abuses. They have recently sought to pass a resolution in the House of Representatives championing the right to participate in them.

The pair’s cancelled trip would have avoided meeting Israeli officials or visiting Israel, apart from to pass through, in a move that was interpreted as adhering to the boycott.

The BDS movement seeks to end the Israeli occupation in the Palestinian territories and discrimination against Palestinian citizens of Israel, who account for almost a fifth of the population. It also demands that Israel allow several million Palestinian refugees and their families to return to their homes.

Israel argues the movement is antisemitic and seeks to dismantle Israel as a Jewish state by reducing its Jewish majority.

While BDS has gathered some high-profile international support, its comprehensive boycott tactics that include academic and cultural isolation have alienated some who support Palestinian rights but also want engagement with Israel and Israelis.

Earlier this year, the Icelandic rock band Hatari hoped to use the stage at Eurovision Tel Aviv to voice their support for Palestinians but were criticised by BDS for attending.