Canberra - Australia has raised the prospect of following the United States by relocating its embassy in Israel from Tel Aviv to occupied Jerusalem in a policy shift that critics described Tuesday as a desperate grab for domestic political gain to win a crucial by-election.

Prime Minister Scott Morrison said Australia remained committed to finding a two-state solution to Israel’s conflict with the Palestinians.

“When sensible suggestions are put forward that are consistent with your policy positioning and in this case pursuing a two-state solution, Australia should be open-minded to this and I am open-minded to this and our government is open-minded to this,” Morrison told reporters.

Israeli Prime Minister Benjamin Netanyahu said he had recently spoken to Morrison and welcomed the Australian policy shift.

Morrison “informed me that he is considering officially recognising [occupied] Jerusalem as the capital of Israel & moving the Australian embassy to [occupied] Jerusalem. I’m very thankful to him for this,” Netanyahu tweeted.

In Indonesia’s capital, Jakarta, Palestinian Foreign Minister Riyad Al Maliki, who was attending solidarity events in the country, said Morrison’s statement was “very sad news” that would violate UN Security Council resolutions.

“Australia, by doing so, is risking trade and business relations with the rest of the world, particularly the Arab world and Muslim countries,” he said at a joint news conference with Indonesia’s foreign minister. “I hope Australia would reconsider that position before taking action.”

Australian Broadcasting Corp. reported that an unnamed Indonesian official had said Jakarta had been taken by surprise by the announcement, which could harm trade negotiations between the two countries.

Morrison and Indonesian President Joko “Jokowi” Widodo planned to sign an agreement this year aimed at boosting trade and investment.

Morrison told Parliament that he had briefed Jokowi overnight about the announcement.

“I’ve been pleased to be able to explain very clearly the nature of the announcements that I’ve made today and I’ve been very pleased with the response that I’ve received from President Joko Widodo,” Morrison said.

“We’ll continue to work closely and cooperatively with our allies and with our partners all around the world on these issues,” he said.

But Indonesia’s Foreign Minister Retno Marsudi said the government questions the merits of Morrison’s announcement and has conveyed its “strong concern.”

Morrison also announced that Australia would vote against a United Nations resolution this week to recognise the Palestinian National Authority as the chair of the Group of 77 developing countries and would review the three-year-old Iran nuclear deal.

The opposition center-left Labor Party said the announcement was a desperate attempt to win the by-election in the Wentworth electorate.

“The people of Wentworth, and all Australians, deserve a leader who puts the national interest ahead of his self-interest, and governs in the best long-term interest of the nation,” Labor lawmaker Penny Wong said.

The Trump administration turned its back on decades of US policy by recognising occupied Jerusalem as Israel’s capital and moving the US Embassy from Tel Aviv in May.

Labor reminded the government that Frances Adamson, the head of Australia’s foreign department, said in June that the US move had “not been helpful” for the Middle East peace process.

George Browning, president of the Australia Palestine Advocacy Network, accused the government of “aligning itself with the most erratic, reactionary and bullish US foreign policy ever.”

“This is an irresponsible policy that compromises the future of millions of people in the Middle East for a handful of votes in Wentworth,” Browning said in a statement.

Morrison denied that the United States or the by-election had influenced his announcement.