Australian Prime Minister Scott Morrison has said that Canberra is open to recognising Jerusalem as Israel's capital, days before a by-election in an area with a high proportion of Jewish people.

Morrison's comments about potentially following US President Donald Trump's controversial decision in December would reverse decades of foreign policy and inflame tension with some of Australia's Asian neighbours.

Morrison's openness to recognising Jerusalem and moving Australia's embassy there comes four days before a by-election in Sydney at which his centre-right coalition runs the risk of losing its tenuous hold on power.

The by-election is in the Sydney harbourside seat of Wentworth vacated by former prime minister Malcolm Turnbull, who was ousted in August in a coup by members of Morrison's Liberal party, the senior partner in a Liberal-National coalition. Morrison will have to negotiate with independents in order to continue governing in a minority if the coalition loses Saturday's by-election.

Census figures show 12.5 percent of people in Wentworth are Jewish, a significantly larger proportion than elsewhere in Australia. The Liberal candidate contesting the by-election on Saturday, Dave Sharma, is a former Australian ambassador to Israel who has floated the idea in the past.

Australia is due to a sign a trade deal this year with Indonesia, the world's biggest Muslim-majority country, where the Palestinian question is a sensitive issue and tens of thousands protested against Trump’s decision.