The Trump administration is backtracking on its threat to order the Palestinians' office in Washington to close.

Last week, U.S. officials said the Palestine Liberation Organization mission had to close because the Palestinians had violated a provision in U.S. law. The provision says the office can't stay open if the Palestinians try to get the International Criminal Court to prosecute Israelis.

But the State Department now says the office can stay open, with restrictions. The United States has told the Palestinians to limit the office's activities to "to those related to achieving a lasting, comprehensive peace between the Israelis and Palestinians."

Get Breaking News Delivered to Your Inbox

The restrictions can be lifted after 90 days if the U.S. and the Palestinians engage in serious peace talks. The State Department says it's optimistic that will happen.

Palestinian leaders had blasted the decision to close the D.C. office. The Palestinian foreign minister denounced the U.S. move as an attempt at "extortion," and on Palestinians said they would suspend all communication with the Trump administration if that happens.

Secretary of State Rex Tillerson determined that the Palestinians ran afoul of an obscure provision in a U.S. law that says the Palestine Liberation Organization's (PLO) mission must close if the Palestinians try to get the International Criminal Court to prosecute Israelis for crimes against Palestinians. A State Department official said that in September, Palestinian President Mahmoud Abbas crossed that line by calling on the ICC to investigate and prosecute Israelis.

Meanwhile, President Trump on Friday said that he still hopes to achieve Middle East peace, despite the "mess" he inherited.

Will be speaking to President Recep Tayyip Erdogan of Turkey this morning about bringing peace to the mess that I inherited in the Middle East. I will get it all done, but what a mistake, in lives and dollars (6 trillion), to be there in the first place! — Donald J. Trump (@realDonaldTrump) November 24, 2017

Earlier this year, Mr. Trump said there is a "very, very good chance" for an Palestinian-Israeli peace deal, but that has proven more difficult that initially expected.