WASHINGTON — The Trump administration imposed sanctions on Wednesday against two top Turkish government officials over the detention of an American pastor being held on espionage charges, threatening to plunge already-fraught relations with a vital NATO ally into crisis.

The move was an extraordinary use of financial sanctions against an allied government. It is sure to inflame tensions that were already simmering over a litany of disagreements, including Washington’s refusal to extradite a cleric suspected of leading a failed 2016 coup against President Recep Tayyip Erdogan of Turkey and his country’s growing use of what many Western analysts have described as hostage diplomacy.

“The relationship is now officially in crisis, and the only way out is for Erdogan to do what he hates the most: back down,” said Julianne Smith, the deputy national security adviser to former Vice President Joseph R. Biden Jr.

The sanctions target Abdulhamit Gul, Turkey’s justice minister, and Suleyman Soylu, the interior minister. They were issued just days after President Trump warned the Turkish government to immediately release the pastor, Andrew Brunson — a demand he made directly last week in a telephone call with Mr. Erdogan.