The U.S. no longer will consider Israeli settlements to be illegal under international law, officials said Monday, in a move that formalizes the Trump administration’s treatment of the West Bank and shifts decades of U.S. policy.

Secretary of State Mike Pompeo announced the new policy at the State Department, drawing swift praise from Israelis and condemnation from Palestinians, European officials and rights groups who say the stance could hinder peace efforts.

Mr. Pompeo’s announcement is unlikely to drastically change conditions on the ground, but enshrines a U.S. policy shift that has moved it ever closer to Israel on several questions, including the fate of Jerusalem, that have bedeviled Middle East peace negotiators for decades. The move further sours ties with Palestinians, who have said the U.S. is no longer a credible arbiter of the peace process.

U.S. officials said the announcement followed a policy-review process and wasn’t meant to affect Israel’s continuing efforts to form a new government after September’s elections. But the move could be seen as a boost to Prime Minister Benjamin Netanyahu, who pledged to annex Jewish settlements in the West Bank ahead of the elections.

Mr. Netanyahu, who has close ties with President Trump, has failed to form a government so far. His opponent, Benny Gantz, has until Wednesday to do so. Mr. Netanyhau also faces possible corruption charges, and the Israeli attorney general is expected to decide whether to indict him in the coming days.