WASHINGTON — President Trump abruptly announced on Thursday that the United States would impose “large sanctions” on Turkey for detaining an American pastor accused of aiding a failed coup attempt there in 2016, escalating a bitter dispute among the two NATO allies.

Mr. Trump’s declaration on Twitter appeared to be more of a muscular threat than an official statement of policy; the administration made no announcement of specific punitive measures against the Turkish government, and the White House declined to provide any details about the steps it was ready to take.

It came one day after Andrew Brunson, 50, an evangelical pastor who has been imprisoned in Turkey for 21 months, was moved from jail to house arrest because of health concerns.

Mr. Brunson is one of 20 Americans charged after the failed coup against President Recep Tayyip Erdogan of Turkey. His case has elevated tensions between the United States and Turkey even as Mr. Trump has sought warmer relations with Mr. Erdogan.