President Donald Trump has dropped Washington's commitment to a two-state solution to the Israeli-Palestinian conflict, backing away from a long-held position of the US and the international community in the Middle East.

In a joint press conference on Wednesday with Israeli Prime Minister Benjamin Netanyahu, Trump said he would back a single-state solution if the two sides agreed to it.

"Looking at two-state or one-state, I like the one that both parties like. I'm very happy with the one both parties like. I can live with either one," Trump told reporters after meeting Netanyahu in Washington.

"The United States will encourage a peace and really a great peace deal ... We will be working on it very, very diligently. But it is the parties themselves who must directly negotiate such an agreement," Trump said.

AL JAZEERA'S SENIOR POLITICAL ANALYST, MARWAN BISHARA: On Trump's comments about a two-state solution: The problem is Netanyahu doesn't agree to two states and does not agree to one state. This whole one state thing means that Jews, Christians and Muslims, Palestinians and Israelis will live in one democratic state. Netanyahu and his coalition do not agree to one state and they reject the two-state solution. The Palestinians agree to one state and they are happy with two states; what they disagree to is an apartheid system, where there are two systems in one land: one superior for Israelis and one inferior for the Palestinians. On Trump's comments about settlements: I think this statement by Trump is absolutely meaningless at this point in time, because the Israelis have already made their plans for 6,000 units that they need today in the West Bank. If Trump was serious, he would have said you need to put a hold on those settlements you just declared while I was busy putting together my administration.

A two-state solution - the idea of Israel and Palestine living side-by-side and at peace - has been the bedrock of US and international diplomacy for the past two decades.

Al Jazeera's James Bays, reporting from the White House, said Trump's comments marked "a very dramatic development" in the search for peace in the Middle East.

"Now, for the first time upending long-standing US policy, Trump says he is not wedded to a two-state solution, and that's a fundamental change - basically ripping up the long-standing roadmap.

"It's going against UN Security Council resolutions; it's going against the agreed position of the international community."

Netanyahu said that he wanted to focus on "substance" and not "labels," when asked about his support for a two-state solution.

"There are two prerequisites for peace. First, the Palestinians must recognise the Jewish state ... Second, in any peace agreement, Israel must retain the overriding security control over the entire area west of the Jordan River," he said.

Trump also said that Washington was working to move the US embassy in Israel from Tel Aviv to Jerusalem.

"I would like to see that happen. We are looking at it very very strongly. We are looking at it with great care. Let's see what happens."

"I'd like to see you pull back on settlements for a little bit," Trump told Netanyahu on the illegal Israeli settlements in Palestinian territories.

Earlier on Wednesday, UN Secretary-General Antonio Guterres had warned that there was "no alternative" to a two-state solution to the conflict, after a White House official said peace did not necessarily have to entail Palestinian statehood a day before.

"There is no alternative solution for the situation between the Palestinians and Israelis, other than the solution of establishing two states and we should do all that can be done to maintain this," Guterres said during a visit to Cairo on Wednesday.

Palestinian officials also issued their warnings to the US against abandoning a two-state solution.

"If the Trump administration rejects this policy it would be destroying the chances for peace and undermining American interests, standing and credibility abroad," Hanan Ashrawi, a senior member of the Palestine Liberation Organisation (PLO), said in response to the US official's remarks.

"Accommodating the most extreme and irresponsible elements in Israel and in the White House is no way to make responsible foreign policy," she said in a statement.

The Palestinians want an independent state in the West Bank and Gaza, with the capital in East Jerusalem, which Israel seized in the 1967 Middle East war.

Netanyahu committed, with conditions, to the two-state goal in a speech in 2009 and has broadly reiterated the aim since. But he has also spoken of a "state minus" option, suggesting he could offer the Palestinians deep-seated autonomy and the trappings of statehood without full sovereignty.

"Many commentators who follow the events in the region would say there's some doubt to whether Netanyahu ever fully believed to a two-state solution," Al Jazeera's Bays said.

"Netanyahu has made clear that the Israelis have to have total control over security in the area ... What the Israelis perhaps are pushing for is the status quo in a permanent form, so Palestinians having some autonomy in their various villages and areas under Israeli control.

"Most Palestinian and Arab commentators would describe that as occupation, and quite possible as apartheid."