US pastor Andrew Craig Brunson escorted by Turkish plain clothes police officers arrives at his house on July 25, 2018 in Izmir.

President Donald Trump has called Turkey's authoritarian leader, Recep Tayyip Erdogan, a "friend." So the White House's recent urgent push for the nation to release detained American pastor Andrew Brunson, including an authorization to double metals tariffs, has surprised markets and political observers alike.

"Our relations with Turkey are not good at this time!" Trump tweeted Friday morning, which helped accelerate losses in Turkey's currency, the lira. The Twitter attack came as the country was already grappling with a debt crisis. The lira was down more than 80 percent against the dollar year to date as of Monday afternoon, and there are concerns that bad loans could become an even bigger problem in the region.

It is unclear what moved the president to ramp up economic pressure on Erdogan's government over Brunson's detention. A glance behind the scenes, on the other hand, shows the pastor's predicament is connected to two people closely linked to Trump who are also central figures in special counsel Robert Mueller's Russia probe.

Jay Sekulow, one of Trump's attorneys in the Mueller investigation, also helps represent Brunson. The pastor had been arrested in Turkey on espionage charges in 2016 related to his supposed connection to an exiled Muslim cleric, Fethullah Gulen. Brunson has denied the charges against him, calling them "shameful and disgusting."

Sekulow serves as chief counsel at the American Center for Law and Justice, a conservative legal organization representing Brunson. On Friday, Sekulow railed against Brunson's detention in a guest host appearance on conservative commentator Sean Hannity's radio show.

Turkey is letting itself get to this point, Sekulow said on Hannity's show, "because they're so intent on holding onto this pastor."

In a phone call, Sekulow told CNBC there was no question of a conflict of interest in his dual roles for Brunson and Trump, noting that "they don't have an adverse party interest." It may actually be beneficial to be "representing the president while representing an American held captive," he suggested.

"We continue to be optimistic that Pastor Brunson will be returned to the U.S.," Sekulow said. "We were pleased when Turkish officials released him to his house under house arrest as a good faith measure, but he needs to be brought home expeditiously."

Vice President Mike Pence and Secretary of State Mike Pompeo have also engaged Turkish officials about the detention of Brunson and other Americans held in Turkey, including NASA scientist Serkan Golge, a White House official told CNBC on Tuesday.

On Monday afternoon, the Trump administration appeared to be working with Turkey beyond the president's Twitter admonitions. An administration official said national security advisor met with Turkish Ambassador Serdar Kilic in the White House to discuss "Turkey's continued detention of Pastor Andrew Brunson and the state of the U.S.-Turkey relationship."

But Bloomberg reported Monday, citing two people familiar with the matter, that Bolton told Kilic that the U.S. has "nothing further to negotiate" until Brunson's release.

While noting that Turkey is "not acting like" a NATO ally by detaining Brunson, Sekulow said that "anytime there's ongoing dialogue, that is a positive move."

Sekulow's intersecting roles — as Trump's lawyer and as a lawyer for a client championed by Trump — aren't the only areas of overlap between the Brunson matter and the Russia probe. Mike Flynn, the president's first national security advisor, has reportedly caught Mueller's attention over an alleged plot to snatch Gulen and turn him over to Turkish authorities.

Erdogan's government has accused Brunson of secretly working for Gulen. Turkey blamed the exiled Muslim cleric and political activist for a botched coup attempt against him in 2016.

In the wake of the failed rebellion, Erdogan notoriously cracked down on journalists and supposed dissidents, jailing thousands of Turkish citizens and officials accused of conspiring with Gulen against him. The cleric was last reported to be living in rural Pennsylvania. Brunson was among those jailed by Erdogan.

While Sekulow defends his client against accusations of being a secret Gulenist, Flynn has reportedly caught Mueller's eye for his alleged involvement in a plan to deliver Gulen back to Erdogan.

Flynn and his son, Michael Flynn Jr., reportedly attended at least one meeting with Turkish representatives, who offered the pair as much as $15 million for successfully delivering Gulen to Turkey, The Wall Street Journal reported in November, citing people familiar with Mueller's investigation.

There was no evidence that Flynn or his son received any money as part of the proposal, which was made in December 2016 in New York, the Journal reported. Flynn's lawyer, Robert Kelner, told the newspaper that the allegations "are false," and a Trump transition team spokesman told the Journal they had no evidence that the meeting took place.

Kelner did not immediately respond to CNBC's request for further comment on the Journal's report.

Flynn has since pleaded guilty to lying to the FBI about his conversations with a Russian ambassador. He has agreed to cooperate with Mueller's probe of the potential links between Russian election attacks and the Trump campaign.