Top members of President Trump’s national security team, with an assist from Mr. Trump himself, broadcast mixed messages over the prospect of future defense cooperation with Russia on Thursday, in the face of a string of military provocations from Moscow in recent days.

Chairman of the Joint Chiefs of Staff Gen. Joseph Dunford said Thursday that U.S. military leaders were prepared to reopen lines of communication with Moscow after meeting with his Russian counterpart in Azerbaijan, while Defense Secretary James Mattis and Secretary of State Rex W. Tillerson took a more skeptical stance, and Mr. Trump said he wasn’t about to tell anyone what he may or may not do.

“Even at the height of the Cold War, we had a capability to talk to the Russians,” Lt. Gen. Frank McKenzie, the Joint Staff’s director of strategic plans and policy, said in a Pentagon statement.

“It is always useful to talk mil-to-mil. It avoids miscalculation; it promotes transparency when we have forces operating in close proximity to each other, as we do in Syria,” Gen. McKenzie added, while making clear that such engagement did not equate to cooperation between the two world powers on the battlefields of Syria against Islamic State, a possibility Mr. Trump discusses on the campaign trail and as president-elect.

But a readout of the meeting by the Russian defense ministry stated both leaders “exchanged views on the security situation in Europe, the Middle East, in North Africa and other key global regions.”

The Baku summit between Gen. Dunford and Russian Army Gen. Valery Makarov Thursday was the first such powwow since the Pentagon cut military ties with Russia after its annexation of Crimea in 2014.

But on the same day in Brussels, Mr. Mattis was sounding a more confrontational tone, telling NATO leaders there was very little doubt the country’s intelligence agencies deliberately interfered in the U.S. presidential elections.

“I would just say there’s very little doubt that they have either interfered or they have attempted to interfere in a number of elections in the democracies,” Mr. Mattis told reporters during a press conference at the alliance’s headquarters.

The Pentagon chief on Thursday also brusquely dismissed Russian Defense Minister Sergei Shoigu’s statement that the Pentagon’s efforts to restore military relations between the two countries from “a position of strength are fruitless.”

“We expect that Pentagon’s position will be clarified today in Baku,” Mr. Shoigu said, according to reports by Russian state-run news outlet TASS.

Mr. Mattis said the only path to renewing military ties with Russia would require a strong American position in those negotiations during a speech to NATO leaders Wednesday.

Washington remains “open to opportunities to restore a cooperative relationship with Moscow,” but the U.S. and its allies remain unwilling “to surrender the values of this alliance nor let Russia, through its actions, speak louder than anyone in [NATO],” the Pentagon chief added Wednesday.

“I have no need to respond to the Russian statement at all,” Mr. Mattis said Thursday. “NATO has always stood for military strength in protection of the democracies and the freedoms we intend to pass on to our children.”

Meanwhile, back in Washington, a defiant President Trump denounced recent Russian military challenges, including the buzzing of U.S. warships, the deployment of a new cruise missile that may violate arms agreements and the presence of a Russian intelligence ship on a leisurely cruise just off U.S. territorial waters in the Atlantic.

Mr. Trump, who faced numerous questions on his campaign’s possible links to Moscow in the 2016 race, denounced the Russian moves as “not good,” but refused to detail whether and how he would retaliate.

“I know politically it’s probably not good for me. The greatest thing I could do is shoot that ship that’s 30 miles offshore right out of the water,” Mr. Trump said. “Everyone in this country’s going to say ‘Oh, it’s great,’” he said, while arguing that “if we could get along with Russia, that’s a positive thing.”

“Hopefully I won’t have to do anything,” the president added.

NATO Secretary-General Jens Stoltenberg told reporters Wednesday that “compliance with arms control agreements is of great importance, and especially when it comes to treaties covering nuclear weapons,” and “any noncompliance of Russia with the INF Treaty would be a serious concern for the alliance.”

The cruise missile has increased the unease on Capitol Hill, where Russia skeptics in both parties have pressed the Trump administration to take a tougher line against the Kremlin’s recent provocations.