American Pastor Andrew Craig Brunson (C), who was charged with committing crimes, including spying for the PKK terror group and the Fetullah Terrorist Organization, arrives at the address, which he was put under house arrest due to his health problems, in Izmir, Turkey on July 25, 2018. (Photo by Evren Atalay/Anadolu Agency/Getty Images)

The White House expects the Turkish government to release the detained American pastor Andrew Brunson in the coming days after reaching a secret deal, NBC News reported Thursday, citing two senior administration officials and another person briefed on the situation.

Brunson is expected to be released after his next court hearing, which is scheduled for Friday. The deal was advanced by Secretary of State Mike Pompeo and National Security Adviser John Bolton during meetings with Turkish officials last month at the United Nations General Assembly meeting in New York City, according to the outlet.

The Turkish lira rallied more than 2 percent on the news to trade at 5.97 per U.S. dollar. The iShares MSCI Turkey ETF, which tracks the performance of Turkish stocks, jumped more than 5 percent to its session high.

The detention of the pastor has been an ongoing source of tension between the U.S. and Turkey, a key NATO ally in the region.

And it has inflamed Trump's religious base, earning special attention from Vice President Mike Pence. One of the president's attorneys, Jay Sekulow, serves as chief counsel at a conservative legal organization that has represented Brunson in the matter.

Turkey has accused Brunson of abetting terrorist groups, which Brunson has denied. In September of last year, Turkish President Recep Erdogan unsuccessfully demanded that the United States hand over the Turkish preacher Fethullah Gulen in exchange for Brunson. Turkey has accused Gulen, who resides in exile in Pennsylvania, of assisting in a failed 2016 coup attempt.

Erdogan told reporters this week, when asked about Brunson, that he would "obey whatever the decision the judiciary gives."

The White House did not immediately respond to CNBC's request for comment. There are some doubts within the administration about how conclusive the deal may be, NBC News reported. One senior official told the outlet that Turkey came close to a similar agreement several months ago. The State Department said Thursday that it was not aware of any deal to secure the release of the pastor, Reuters reported.

The news of Brunson's potential release comes as Turkey and another U.S. ally, Saudi Arabia, are engaged in a dispute over the disappearance of a Saudi journalist, Jamal Khashoggi, who has not been seen since entering the Saudi Arabian consulate in Istanbul earlier this month.

A number of anonymous Turkish police sources have told domestic and international news outlets that the Turkish government believes that Khashoggi was murdered on the orders of the Saudi government.

NBC reported that while the details of the agreement weren't immediately clear, it does include a U.S. commitment to scale back economic pressure on Turkey. The United States slapped sanctions on Turkey over the summer as a result of the pastor's detention.

Read the full story at NBC News.

-- CNBC's Fred Imbert contributed to this article.