President Trump shakes hands with Recep Tayyip Erdogan, Turkey's president, at the White House on May 16, 2017. Tensions between the two have recently escalated. (Michael Reynolds/Bloomberg)

President Trump on Thursday appeared to publicly acknowledge for the first time that his administration helped negotiate the release of a Turkish national being held in Israel as part of a broader deal that would have freed an American pastor jailed in Turkey.

The breakdown of the deal has led to weeks of increasing tensions between Trump and Turkish President Recep Tayyip Erdogan that threaten the relationship between the United States and a key NATO ally that straddles Europe and the Middle East.

Trump brought up the dispute at a Cabinet meeting Thursday, requesting an update on sanctions he recently slapped on ­senior Turkish leaders over the detention of American Andrew Brunson.

“Turkey, they have not proven to be a good friend,” Trump said. “They have a great Christian pastor there. He’s a very innocent man. . . . I just think it’s a terrible thing that they’re holding him.”

He then seemed to acknowledge that he was disappointed that Turkey did not release Brunson after the United States helped negotiate the release of the Turkish national jailed in Israel.

“We got somebody out for him,” Trump said, referring to Erdogan. “He needed help getting somebody out of someplace; they came out.”

“They want to hold our wonderful pastor,” Trump added. “Not fair. Not right.”

Perhaps unwittingly, Trump opened a window into what is behind the intensity of the standoff with Erdogan, a strongman who shares Trump’s highly personalized, top-down leadership style and emphasis on projecting strength and rallying national pride.

Neither wants to be the one who blinks amid hard feelings over who is responsible for the deal falling apart.

In a tweet Thursday evening, Trump escalated his language on Brunson, describing the pastor as a hostage and declaring, “We will pay nothing for the release of an innocent man, but we are cutting back on Turkey!”

“Turkey has taken advantage of the United States for many years,” Trump said in the tweet. “They are now holding our wonderful Christian Pastor, who I must now ask to represent our Country as a great patriot hostage.”

The Washington Post reported July 26, citing a person familiar with the arrangement, that Trump had directly intervened with Israeli Prime Minister Benjamin Netanyahu to win the release last month of Ebru Ozkan, a Turkish woman accused of being a smuggler for the Palestinian military group Hamas.

Brunson’s release after nearly two years in jail was supposed to be the next step in a multipart deal worked out by diplomats and by Trump and Erdogan directly during a meeting at the July NATO summit in Brussels, said other officials familiar with the plan who spoke on the condition of anonymity to discuss the sensitive negotiations.

Trump’s July 14 phone call to Netanyahu came two days after the close of the NATO summit, where he singled out Erdogan for praise and fist-bumped the grinning Turkish leader.

Trump and Vice President Pence were incensed when a Turkish court instead ordered Brunson released from jail but held under house arrest. Trump directly blamed Erdogan, raging to aides that the Turkish leader had reneged on their handshake deal, people familiar with his reaction said.

Pence has been closely involved in the Brunson negotiations, largely because the minister has become a major cause among American evangelicals, who turned out overwhelmingly for Trump in the 2016 election and have remained among his most loyal supporters.

Trump took the collapse of the negotiations as a personal slight and is furious at the appearance that the United States was duped, U.S. officials said. Trump has complained that Erdogan is trying to make him look “weak,” one official said.

The administration responded with human rights sanctions that were unusually harsh — targeting two senior government ministers rather than lower-level officials — and has prepared even stiffer financial penalties that could be applied at any time.

“We have more that we are planning to do if they don’t release him quickly,” Treasury Secretary Steven Mnuchin told Trump at the Cabinet meeting, without providing details.

Trump also announced last week that the United States was doubling tariffs on imported Turkish metals.

Turkey has responded by declaring that it will raise tariffs on several U.S. imports, including cars, tobacco and spirits.

Erdogan this week accused the U.S. leader of attempting to bully him.

“We feel that Turkey, and specifically President Erdogan, have treated Pastor Brunson — who we know to be a very good person and a strong Christian who’s done nothing wrong — very unfairly, very badly,” White House press secretary Sarah Huckabee Sanders said Wednesday. “And it’s something that we won’t forget in the administration.”

The Brunson case was the flash point for a standoff with Erdogan, although the larger U.S.-Turkey dispute involves Erdogan’s tilt toward Iran and Russia, his purchase of Russian armament instead of NATO materials and a brewing trade war.

The relationship deteriorated over the past year, despite what the White House sees as an extraordinary effort capped by Trump’s personal diplomacy in Brussels.

“Trump thinks he’s done a lot, and he comes to Erdogan with one of his concerns — Brunson — and it doesn’t happen,” said Amanda Sloat, a former State Department official who is now a Turkey specialist at the Brookings Institution.

The U.S. effort included a flurry of diplomatic meetings in February involving Defense Secretary Jim Mattis, then-Secretary of State Rex Tillerson and then-White House national security adviser H.R. McMaster, and a plan by Tillerson to create several working groups.

In June, Secretary of State Mike Pompeo told Turkey that the FBI would investigate what Turkey claims are U.S. groups that support a Turkish cleric whom Erdogan blames for an attempted coup.

Federal prosecutors also dropped assault charges against several security guards for Erdogan who were allegedly involved in a melee in May 2017 outside the Turkish ambassador’s residence in Washington.

Video of the incident, which showed guards for the visiting Turkish president charging and beating protesters who had gathered outside the Sheridan Circle residence, sparked international condemnation.

Trump and Erdogan got along well at the start of Trump’s presidency, and with good reason. ­Unlike many European leaders Trump found snooty or weak, Erdogan is earthy and carries himself with a hint of street-tough swagger. Both Trump and Erdogan frequently pick out enemies for attack; both have been called bullies.

“Something went wrong, or something was misunderstood” after Brussels, and now the two leaders are in a faceoff that it is difficult for either to defuse, Sloat said.

The administration’s threat Thursday to impose more sanctions escalates the dispute, and “Erdogan certainly does not like to look like he is folding,” Sloat said.

Current and former U.S. officials said Erdogan has misjudged Trump, despite their similarities, and overplayed his hand.

U.S. and Turkish officials whisper differing versions of how the deal fell apart and whether Trump was willing to trade a Turkish banker convicted in New York of helping Iran evade U.S. sanctions.

Turkish media outlets have reported that the banker would have been sent to Turkey to serve his sentence.

Erdogan sees Brunson as a “bargaining chip” whose price was especially high because of the White House interest in his case, said Aykan Erdemir, a senior fellow at the Foundation for Defense of Democracies.

“Erdogan has a tactic of hostage diplomacy,” Erdemir said, adding that the United States would be treading on potentially dangerous ground if it agreed to release the banker, Mehmet Hakan Atilla, who was sentenced in May to 32 months in prison.

“There is a kind of moral imbalance in the leaked deal — you’re swapping a convicted sanctions buster for an innocent pastor,” Erdemir said.