Palestinians represented by an Israeli lawyer took the case to the Supreme Court, along with Peace Now, a left-wing Israeli group that opposes the settlements. The case dragged on for years, but last summer the court said the outpost had to be dismantled by the end of March 2012, a deadline the new ruling extends to Aug. 1.

The government of Prime Minister Benjamin Netanyahu, which is a strong defender of the settlers and wanted to avoid a confrontation, suggested a compromise — let the residents of Migron remain until a new authorized community could be built nearby where they could relocate upon its completion in 2015.

The plaintiffs returned to the court last week and told the court that to accept such a deal would be to flout the rule of law.

One of the three justices who heard last week’s arguments, Salim Joubran, indicated the court’s leanings at the time: “You say the outpost will move in three years, but I know this type of behavior. Three years will inevitably turn into eight.”

Right-wing legislators said Sunday that they would introduce legislation to legalize Migron and other outposts. Dani Dayan, a leader of Israel’s settler movement, said that the court’s ruling would empower the violent extremists in his community who have long argued that there was no point in seeking compromise.

Tzaly Reshef, a founder of Peace Now and a lawyer, said the decision would not change the fact that “supporters of the settlements remain in power.” But he called it “very meaningful in terms of the constitutional system in Israel.”

Mr. Reshef said that had the case been decided the other way, “it would have been almost the end of the existence of the courts as the protectors of the rule of law in this country, as well as the ultimate victory of the settlers.”