Israel has to choose between a two-state solution in the Israeli-Palestinian conflict or an "apartheid system", the British foreign secretary told The Jerusalem Post on Wednesday.

Boris Johnson made a quick 24-hour visit to Israel and the occupied Palestinian territories on Wednesday in which he met politicians and figures from both sides of the conflict.

He reaffirmed British support for Israel and said the priority in any Israeli-Palestinian accord has to be "the safety and security" of Israel, but criticised settlement building in the occupied West Bank.

"What we are saying is that you have to have a two-state solution or else you have a kind of apartheid system," Johnson said in an interview published by the Post on Thursday.

"Israel is a country of great creative genius, and the priority has to be the safety and security of the people of Israel. If you can guarantee that, maybe there is some way of also giving autonomy to the Palestinians," the foreign secretary said shortly after meeting Benjamin Netanyahu, Israel's prime minister.

US President Donald Trump cast uncertainty over his country's long-time commitment to the idea of a two-state solution when he met Netanyahu at the White House in February. Trump said he would be open to a single state if it led to peace and if the parties were happy about it.

Palestinians are worried that under current conditions, Jews and Arabs living together in a single Israeli state would not be given the same rights, but rather live side by side in a state of "apartheid".

Johnson stressed that his government's policy was "absolutely unchanged" and they remain committed to two states in meetings with both the Israelis and the Palestinians.

In his meeting with Netanyahu, Johnson affirmed that although Britain's support was "rock-solid", Theresa May's cabinet was worried about "settlements, and the accelerated rate of settlements and demolitions".

The Jerusalem Post quoted sources in Netanyahu’s office saying that during their meeting, the Israeli prime minister attacked the "obsessive approach that the settlements are the root of the conflict," an approach he said ignores the fact that the Palestinians refuse to recognise Israel as the nation-state of the Jewish people.

"You are talking to an admirer and supporter of Israel," Johnson said. "But we must never forget there is a chronic problem, and that problem is what it is going on in the occupied Palestinian Territories."

With all of Israel’s "ingenuity", he said, there must be a way to pave the way for a Palestinian state while preserving Israel’s security.