BRUSSELS — In his NATO debut this week, acting defense secretary Patrick Shanahan sought to reassure skeptical U.S. allies about transatlantic strains over defense spending, arms control and Afghanistan.

Appearing at his first meeting of NATO defense ministers since becoming Pentagon chief at the beginning of the year, the former Boeing executive delivered a message of unity but also gently pressed partners to increase contributions to the alliance and think more creatively about new threats.

Underlying the scripted interactions at NATO headquarters in Brussels was a central question for nations unnerved by the departure of his predecessor, Jim Mattis, a widely respected retired Marine general who quit in December: Can anyone, especially someone with limited defense experience who’s auditioning for a job, steer President Trump away from damaging decisions?

“This is a huge moment for Shanahan,” said Jim Townsend, an adjunct senior fellow at the Center for a New American Security who served as deputy assistant secretary of defense for Europe and NATO during the Obama administration.

If Shanahan wants to make his position permanent, Townsend said, he must show Trump he can be forceful with allies publicly while also cajoling them behind closed doors to meet military spending goals.

Fellow defense ministers who were searching for positive signals from Shanahan were able to find them. He offered friendly words about the NATO “family” and appeared to make only limited criticism of Germany, one of Trump’s favorite punching bags, for defense budget plans that fall short of its NATO commitments.

Speaking to reporters at the close of the session, Shanahan sought to reconcile his statements of support with those of his commander in chief, whose “America First” instincts have fueled friction with allies and made mayhem the new normal at global gatherings. At a NATO summit in July, Trump stunned heads of state by demanding a massive boost to defense spending and suggesting he might “go his own way” if members did not increase contributions. His refusal to consistently express support for mutual defense obligations has become a troubling backdrop to alliance consultations.

Vaulting into the public eye during his inaugural overseas trip, Shanahan has focused on Trump’s statements of support rather than his disparagements. “What I hear from President Trump is we, collectively, all need to do more. His message to NATO has been, ‘We need to do more,’ ” he said. “I don’t think there is a divergence. We have to do this together.”

Vice President Pence, in a speech Wednesday in Poland, one of the few NATO nations that currently meets defense spending goals, voiced White House support for the alliance but reiterated that American welfare and prosperity would take precedence.

Shanahan, who left a long career in the aviation industry in 2017 to take the No. 2 position at the Pentagon, must walk the same tightrope that Mattis did between presidential and Pentagon positions. Mattis was well known in Europe because of his stint as a NATO commander and his years overseeing coalition combat in Afghanistan and Iraq, but Shanahan’s policy views are less known to allies.

Even Mattis, over time, proved unable to steer Trump away from decisions he appeared to question, including pulling out of the nuclear deal with Iran and a more recent move to accelerate America’s exit from Syria. Mattis ultimately quit over the president’s disregard for traditional alliances.

Diplomats privately acknowledged that neither Shanahan nor any other U.S. official is able to fix the fundamental problem of the Trump era: Many leaders doubt that the president backs the more conventional views often offered up by his subordinates.

“Shanahan sent a very clear message that the United States is very committed to NATO. The problem is different,” said a senior NATO diplomat, speaking on the condition of anonymity to talk frankly about alliance fears. “If there’s a situation that would require a quick response in the Balkans or the Baltics, will President Trump deploy troops? No one can answer this.”

A major test of America’s continued ability to corral allies lies in Afghanistan, as the Trump administration launches an accelerated effort to foster peace talks and explores significant troop reductions in line with the president’s long-standing desire to end counter­insurgency wars.

Participants in the discussions said Shanahan told his fellow ministers that the United States would take decisions only in coordination with NATO partners. That is a key demand, since most countries depend on U.S. infrastructure and resources to sustain their deployments in the country.

Hanging over that discussion was the question of whether U.S. allies could fully trust assurances that countries taking part in the NATO mission to Afghanistan would receive real insight into Trump’s plans for any withdrawal, the diplomat said.

The uncertainty spoke to a broader problem for NATO allies, who say they have little alternative other than Washington on ­defense-related issues ranging from Afghanistan to the Kremlin.

“We still have to rely on American institutions. There is no backup plan for the United States,” said Latvian Defense Minister Artis Pabriks, whose country is hosting a Canadian-led deployment of NATO troops intended to form a deterrent against neighboring Russia. “There was nothing shocking in what he said.”

NATO ministers are also looking for indications that the Trump administration’s plans to withdraw from the Intermediate-Range Nuclear Forces Treaty, a Cold War arms control agreement that Western nations say Russia has violated, won’t launch a new arms race, heightening security risks to Europe. On that and other issues, Shanahan telegraphed a lockstep approach but also urged the alliance to broaden its response to emerging challenges from Russia, China and cyber threats.

“Bottom line: Shanahan said all the right things,” Townsend said. “But I just don’t think that’s what the White House thinks, and they’re the ones in charge.”

Even if Shanahan’s messages were largely similar to Mattis’s, his style was starkly different, participants in the meeting said. Mattis was a decorated general who had years of experience with NATO’s sometimes boggling jargon, deployments and ways of thinking. Shanahan’s comments in meetings did not appear to stray far from his prepared script, reflecting either caution or a desire not to bungle the details, participants said.