Netanyahu has said he would honor the ruling, while Jewish settlers and their hard-line allies in Netanyahu's government have vowed to resist the order.
Netanyahu announced his decision shortly after parliament rejected an attempt by hard-line lawmakers to prevent the Ulpana demolition. The proposal sought to leave the buildings, home to 30 families, intact and instead compensate the Palestinian landowners. But under pressure from Netanyahu, the parliament resoundingly defeated the measure by a 69-22 vote.
Netanyahu opposed the bill, saying it would likely be overturned by the Supreme Court and generate harsh international criticism.
In order to blunt settler anger, Netanyahu has come up with a novel solution: Instead of demolishing the buildings, he plans on removing them from their foundations and transferring them to the nearby settlement of Beit El. In addition, he said he would build 300 more homes in Beit El.
"Israel is a democracy that observes the law, and as prime minister I am obligated to preserve the law and preserve the settlements, and I say here that there is no contradiction between the two," Netanyahu said.
"This formula strengthens settlements," he added. ""The court ruled what it did, and we respect its decision. In parallel, Beit El will be expanded. The 30 families will stay in Beit El and they will be joined by 300 new families."
Chief Palestinian negotiator Saeb Erekat condemned the new construction. "This is a very grave development, this undermines all efforts to revive the peace making between the two sides," he said.
In Washington, State Department spokesman Mark Toner said the planned construction "undermines peace efforts." He said, "We do not accept the legitimacy of continued Israeli settlement activity. And, we want to see both parties refrain from these kinds of actions and to get back into negotiations."
An Israeli official said it was unclear how long the Ulpana move would take or how much it would cost. He said the plan is for the homes in Ulpana to be removed from their current location by the July 1 deadline. It is possible the residents will need temporary housing while the buildings are transferred. He spoke on condition of anonymity because final details still need to be worked out.
Netanyahu's plan has come under fire from various quarters. Critics say the move is unnecessarily expensive and complicated. Settlers reject any move of the buildings.
About 2,000 settlers, nearly all of them observant Jews, with men wearing knit skullcaps and females in long skirts, demonstrated outside the parliamentary building ahead of Wednesday's vote, and some activists have begun hunger strikes to protest the planned destruction of Ulpana.
Settler leaders have promised to resist the order, though they say their opposition will be peaceful. Police said two arrests were made when young demonstrators scuffled with authorities.
"The Knesset chose destruction instead of construction. We will not be deterred. We will continue to build," said settler leader Dani Dayan.
Jewish settlements are at the heart of the current impasse in Mideast peace efforts.
Peace talks between Israel and the Palestinians broke down three years ago, and the Palestinians refuse to restart negotiations until Israel freezes settlement construction in the West Bank and east Jerusalem.
The Palestinians claim both areas, captured by Israel in the 1967 Mideast war, for a future state. With 500,000 Israelis now living on land claimed by the Palestinians, they say their dream of gaining independence is growing ever more distant.
Netanyahu says talks should resume without any preconditions and has rejected calls for a full settlement freeze.