Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

President Donald Trump’s threat to cut aid to the Palestinians and nuclear-armed ally Pakistan is not simply a case of saving a few hundred million dollars spent on problems in faraway countries, analysts and former officials said Wednesday.

One expert warned that such a move could drive impoverished refugees into the arms of extremists and further destabilize the Middle East.

Meanwhile, the chairman of Pakistan's Senate Defense Committee branded Trump as the "mercurial leader of a declining superpower" and accused him of "raving and ranting."

Trump used some of his first tweets of 2018 to criticize countries including North Korea, Iran, Pakistan as well as the Palestinian territories.

On Monday, he questioned the returns seen by Washington and suggested that he could withdraw annual support to Pakistan. The president said that the U.S. had "foolishly" given $33 billion in aid to Islamabad over the past 15 years and accused it of being a "safe haven to the terrorists."

The United States has foolishly given Pakistan more than 33 billion dollars in aid over the last 15 years, and they have given us nothing but lies & deceit, thinking of our leaders as fools. They give safe haven to the terrorists we hunt in Afghanistan, with little help. No more! — Donald J. Trump (@realDonaldTrump) January 1, 2018

Pakistan is a longtime but an uneasy ally to Washington. Civilian and military chiefs there rejected Trump's comments Tuesday as "completely incomprehensible," and the U.S. ambassador was summoned.

"The real risk on that Trump-Pakistan debate is it exacerbates the situation because you know they are going ballistic about this," said Scott Lucas, a professor of American studies at the U.K.'s University of Birmingham.

U.S. criticism of Pakistan is nothing new, but Lucas said there did not appear to be a clear, underlying strategy behind Trump's messages.

"It's going to complicate our relationship with them for a while," he said.

Mushahid H. Syed, the chairman of Pakistan's Senate Defense Committee, said Trump was trying to "bully, blame and browbeat" his country.

He added that "scapegoating Pakistan suits the American establishment to cover up the Pentagon's failures" in neighboring Afghanistan.

In addition to U.S. funding lavished on Pakistan in terms of military and civilian aid, the port of Karachi is key for keeping supplies flowing to NATO troops in Afghanistan.

Scott said withdrawing aid would be an isolationist move for the U.S. that would allow others to step into the vacuum. Last year, the Pentagon warned that China could soon establish a military base in the Islamic republic.

“The risk is that the U.S. is not an ‘indispensable nation’ anymore, which is what Madeleine Albright said in the 1990s,” he said, referring to a famous phrase used by the former secretary of state. “The wider significance here is that what Trump is doing is threatening to put the U.S. off to the side of world issues — other countries could step in.”

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Trump turned his attention to the Palestinians on Tuesday, blaming them for a lack of progress in the Middle East peace process and complaining that the U.S. gets "no appreciation or respect" for the "HUNDRED [sic] OF MILLIONS OF DOLLARS" it pays to them each year.

...peace treaty with Israel. We have taken Jerusalem, the toughest part of the negotiation, off the table, but Israel, for that, would have had to pay more. But with the Palestinians no longer willing to talk peace, why should we make any of these massive future payments to them? — Donald J. Trump (@realDonaldTrump) January 2, 2018

As when Trump upended decades of U.S. policy by recognizing Jerusalem as Israel's capital last month, his latest comments have been welcomed by some on the Israeli side and rejected by Palestinian officials.

Miri Regev, Israel's culture and sports minister, said that Trump was restoring "a sane discourse to the entire world."

Likewise, Israeli Education Minister Naftali Bennett said that the U.S. president "is not afraid to say the truth, even if it's not popular" and alleged that "the Palestinian leadership continues to fund terrorists using U.S. tax monies."

On the flipside, Hanan Ashrawi, a member of the Palestine Liberation Organization's executive committee, offered an angry reaction.

"We will not be blackmailed … Palestinian rights are not for sale," Ashrawi said. "President Trump has sabotaged our search for peace, freedom and justice. Now he dares to blame the Palestinians for the consequences of his own irresponsible actions."

But some independent observers believe that, in private at least, some within the Israeli government will also be uneasy with the president's threat to cut aid.

U.N. Ambassador Nikki Haley backed up Trump's comments on Tuesday after being asked about the U.S. contributions to UNRWA, the United Nations' Relief and Works Agency for Palestinian Refugees.

The U.S. is UNRWA's largest donor, providing £364 million — about one-quarter of its entire budget — last year.

The organization says it uses this money to provide assistance to more than 5 million refugees in the Gaza Strip, West Bank, Syria, Lebanon and Jordan.

Related: Trump's Jerusalem move undermines U.S. interests, analysts say

The U.S. has also given an average of $400 million per year in direct support, most of which goes through projects administered by USAID and the rest to the Palestinian Authority, the region's semi-autonomous government known as the P.A.

As an occupying power, Israel is formally responsible for the welfare of Palestinians. The existence of the international-funded Palestinian Authority means Israel no longer needs to shoulder that financial burden.

Israel also has a security interest in the continued functioning of the authority, since Palestinian security services cooperate with Israel to prevent attacks by Hamas and other militant groups.

The main focus of the U.S. money is "promoting the prevention or mitigation of terrorism against Israel," according to a congressional report in 2016.

"It's the childishness and oversimplification of these issues that worries me"

The U.S. also provides more than $3 billion to Israel in military assistance each year.

The consequences of stripping away aid to the Palestinians worries some analysts.

"I'm not saying the P.A. does a fantastic job, but if you cut money from the P.A. and UNWRA then who is going to look after the refugees?" said Yossi Mekelberg, a professor of international relations at Regent's University London.

He said that while some Israeli politicians have supported the move, others would be quietly aware of the potential consequences.

"If you are going to have thousands and thousands of people unemployed then you are playing into the hands of the extremists," Mekelberg added.

One former official, ex-Israeli military spokesman Peter Lerner, tweeted words to that effect Wednesday, saying that Trump's proposal "hurts the weakest members of Palestinian society and is unlikely to bring the Palestinian Authority to the table."

2/3 The refugee camps have historically been hotbeds for terrorist activities, weakening this population will only lead to more extremism and violence. This will not contribute to security or stability in the region. — LTC (R) Peter Lerner (@LTCPeterLerner) January 3, 2018

Another former official, Chuck Freilich, Israel's former deputy national security adviser, called the UNRWA "a corrupt and dysfunctional organization that perpetuates the Palestinian refugee problem."

But even he said that while some financial pressure might be appropriate, Trump should also seek to "minimize differences with the Palestinians and regain their confidence in its ability to play a constructive mediating role."

UNRWA spokesman Chris Gunness said in an email: "UNRWA has not been informed by the United States administration of any changes in U.S. funding to the agency."

Palestinians clash with Israeli troops following a protest against President Donald Trump's decision to recognize Jerusalem as the capital of Israel, in the West Bank city of Nablus, on Dec. 22, 2017. Majdi Mohammed / AP file

Pakistan and Palestine are issues that have troubled U.S. officials long before Trump, but his new-year intervention appeared to achieve little beyond causing considerable animosity, according to Mekelberg.

"Raising concerns with Pakistan and raising concerns with the Palestinian Authority is fair enough but it's the childishness and oversimplification of these issues that worries me," he said.