President Donald Trump has injected unpredictability into U.S. foreign policy that has unnerved the establishment — but is now bearing some fruit.

Last week, Reuters reported that NATO members spending on their own defense has grown the fastest it has in three years due to pressure from Trump, who had repeatedly questioned NATO’s value on the campaign trail.

Trump appears to be using that playbook of unpredictability with other parts of the globe, prompting critics to accuse him of going “off script” and undercutting his own top foreign policy surrogates.

When Trump refrained from reaffirming Article 5 in Brussels in May, the foreign policy establishment fretted over the message it was sending to allies. Some said Trump had undercut his National Security Adviser H.R. McMaster, who had told allies that Trump would do so.

However, the next month, Trump unexpectedly — and unequivocally — reaffirmed Article 5 at a Rose Garden press conference with the Romanian president in response to a question by a Romanian journalist.

“I’m committing the United States, and have committed, but I’m committing the United States to Article 5. And certainly, we are there to protect. And that’s one of the reasons that I want people to make sure we have a very, very strong force by paying the kind of money necessary to have that force. But, yes, absolutely, I’d be committed to Article 5,” he said on June 9.

McMaster himself mocked the frenzy over Trump not reaffirming Article 5 in Brussels as a “manufactured sort of controversy.”

“He was very clear in saying everything but that explicit phrase that everyone was looking for, for some really odd reason. And Chancellor Merkel gave a speech just before it — I don’t think she said explicitly ‘And I reaffirm my commitment to Article 5,'” he said.

Harry Kazianis, director of defense studies at the Center for the National Interest, said this unpredictability is part of Trump’s negotiating strategy.

“He is not going to ever likely use the same tactics and strategies that foreign policy wonks like myself are accustomed to. When it comes to things like Article 5, Trump held back on a full endorsement for a simple reason. His goal was to extract concessions from his European allies to spend more or at least to commit to bigger spending in the future, even though Vice President Pence and others were already committing to Article 5,” he said.

“This might unnerve some people in Brussels and other capitols, but clearly he has his own way conducting foreign policy — and we should get use to it,” he said.

Over and over, the refrain has emerged — that Trump has gone off script, or is undercutting his own cabinet officials. But as events played out, Trump’s unpredictability has shown to have a purpose.

When Trump castigated Qatar as a funder of terrorism at that same Rose Garden press conference, journalists claimed he had undercut Tillerson — who had earlier called on Qatar to stop supporting terrorists, but also for calm and for the easing of a blockade of Qatar.

But when asked by the top Democrat on the House Armed Services Committee three days later to address the “disconnect” between the messages, Mattis suggested the two goals were not mutually exclusive and that diplomacy was messy.

“It’s not tidy. I will admit it’s not tidy, but it’s something that we’ve got to work together on,” he said.

The administration is continuing to use this dual approach ahead of a deadline for negotiations on Wednesday.

On Sunday, the State Department encouraged all parties to “exercise restraint to allow for productive diplomatic discussions,” while Trump spoke with the leaders of Saudi Arabia, Abu Dhabi, and Qatar about his “overriding objective” of stopping terrorism funding.

Trump on Monday morning hinted things might be on the verge of a breakthrough.

Spoke yesterday with the King of Saudi Arabia about peace in the Middle-East. Interesting things are happening! — Donald J. Trump (@realDonaldTrump) July 3, 2017

“Spoke yesterday with the King of Saudi Arabia about peace in the Middle-East. Interesting things are happening!” he tweeted.

James Carafano, vice president of the Kathryn and Shelby Cullom Davis Institute at the Heritage Foundation, said Trump’s foreign policy approach needs to be viewed through a different lens.

”It is absolutely true that if you look at all these public statements and everything, in the kind of traditional way of American statecraft and traditional language and everything else, it seems a bit discordant. That’s because they’re not talking in traditional ways of American statecraft. And our president of the United States is never likely to do that,” he said.

When Trump tweeted on June 20 that relying on China to help with North Korea “has not worked out,” journalists were also quick to criticize him for being out of step.

One reporter asserted that his tweet had “upended” all the work he and his top cabinet officials had done to get China onboard and caught “multiple Trump administration officials off guard.” Another said Trump seemed to be “exonerating his new buddies in Beijing.”

Yet Trump’s tweet actually foreshadowed a shift to increased pressure on China.

While I greatly appreciate the efforts of President Xi & China to help with North Korea, it has not worked out. At least I know China tried! — Donald J. Trump (@realDonaldTrump) June 20, 2017

The next day, Tillerson and Mattis met with their Chinese counterparts, with Tillerson pressuring China to do more about North Korea.

And the administration undertook a full-court-press last week, with McMaster calling out China at a national security conference in Washington, Trump welcoming the South Korean president to the White House, the Treasury Department sanctioning two Chinese businessmen and a company, and the State Department announcing a $1.3 billion arms deal with Taiwan.

On Sunday, Trump spoke with the Japanese prime minister, expressing “unity with respect to increasing pressure on [North Korea] to change its dangerous path.” He also spoke with the Chinese president and “raised the growing threat” posed by North Korea’s nuclear and ballistic missile programs, according to a White House statement.

Trump’s tweet, Kazianis said, “suggested a sea change is coming, one China won’t like.”

“If I were China, I would be getting off my ass right about now,” Barton Swaim, author of The Speechwriter: A Brief Education in Politics, wrote in a Washington Post column analyzing the tweet.

Reports also inexplicably claimed that Pentagon officials were caught “off guard” when the White House issued a statement warning Syria not to conduct another chemical weapons attack. Chief Pentagon Spokesperson Dana White said the Defense Department had actually helped edit the statement before it was released.

Mattis later told reporters that the statement worked to get Syria to back off its preparations for another attack.

A senior administration official said reports that the White House is out of step with Tillerson or Mattis have no merit.

“The President has enormous confidence in both Secretary Tillerson and Secretary Mattis and we don’t have any further comment on palace intrigue/soap opera stories,” the official told Breitbart News.

Nikki Haley, Trump’s ambassador to the United Nations recently told Congress that the president’s unpredictability has helped her.

“I deal with 192 [countries], and the overwhelming feeling is that we are unpredictable. They don’t know exactly what we are going to do,” she said, according to Foreign Policy.

“In my job I found it’s made my negotiations better, and it’s made them easier because they don’t assume. They don’t take us for granted anymore. They no longer look at us as one they can just push over.”

Kazianis said allies need to know the U.S. will honor treaty commitments and that in times of crisis the U.S. will be there, but he said, “a little ambiguity is a good thing and can go a long way.”

“Trump is taking his business playbook, which has earned him billions of dollars over the decades, and is applying it to his foreign policy goals,” he said. “Every move, while maybe not part of a masterplan that is concrete, is part of a loose playbook to achieve certain big objectives.”

“Holding some cards close is never wrong—it’s just different. And that is what shocks everyone.”