BRUSSELS/UNITED NATIONS (Reuters) - The European Union’s foreign policy chief and the United Nations secretary-general on Tuesday criticized an Israeli move to legalize thousands of settler homes on Palestinian land in the occupied West Bank.

European Union foreign policy chief Federica Mogherini addresses a joint news conference with Libya's Prime Minister Fayez al-Sarraj (unseen) at the EU Commission headquarters in Brussels, Belgium February 2, 2017. REUTERS/Francois Lenoir

The EU’s Federica Mogherini said that the law, if it was implemented, crossed a new and dangerous threshold.

“Such settlements constitute an obstacle to peace and threaten the viability of a two-state solution,” she said.

“(It) would further entrench a one-state reality of unequal rights, perpetual occupation and conflict,” she said, highlighting that the EU sees Israeli settlements in the occupied Palestinian territories as illegal.

The Israeli parliament passed the legislation two weeks after the inauguration of President Donald Trump as the new U.S. president. Trump has signaled a softer approach to the settlement issue than that of the previous U.S. administration.

It retroactively legalizes about 4,000 settler homes built on privately owned Palestinian land.

U.N. Secretary-General Antonio Guterres said the action went against international law and would have legal consequences for Israel.

“The Secretary-General insists on the need to avoid any actions that would derail the two-state solution,” his spokesman Stephane Dujarric said in a statement, referring to longstanding international efforts to resolve the Israeli-Palestinian conflict.

French President Francois Hollande also added his voice to the condemnation, saying it paved the way for the annexation of the occupied Palestinian territories.

“I think that Israel and its government could revise this text,” Hollande said at news conference after meeting Palestinian President Mahmoud Abbas.

Abbas called the law an aggression against the Palestinian people. Other Palestinian leaders described it as a blow to their hopes of statehood.

Most countries consider the settlements, built on land captured by Israel in the 1967 Middle East War, illegal and an obstacle to peace as they reduce and fragment the territory Palestinians seek for a viable state in the West Bank, East Jerusalem and the Gaza Strip.

Israel disputes this and cites biblical, historical and political connections to the land, as well as security needs.

Though the legislation was backed by Prime Minister Benjamin Netanyahu’s right-wing coalition, it has raised tensions in the government. Israel’s attorney-general has said the law is unconstitutional and that he will not defend it at the Supreme Court.

A White House official said on Monday that, given the new law is expected to face challenges in Israeli courts, the United States would withhold comment for now.

The Trump administration has signaled a far softer approach to the settlement issue than that of the Obama administration, which routinely denounced settlement announcements.