WASHINGTON — The United States and Turkey have lifted sanctions against top officials in each other’s government in a mutual sign on Friday of warming diplomatic relations between the two NATO allies after last month’s release of an American pastor.

The Trump administration had imposed financial sanctions on two Turkish officials in August to punish the country for the two-year detention of the pastor, Andrew Brunson. In turn, Turkey placed its own sanctions on Attorney General Jeff Sessions and Kirstjen Nielsen, the homeland security secretary.

In Ankara, Hami Aksoy, the Turkish Foreign Ministry spokesman, said the sanctions against Mr. Sessions and Ms. Nielsen “responded according to reciprocity principle, which is basis of diplomatic practices.”

He said those constraints — which included a travel ban to Turkey, the freezing of any assets in Turkey and a ban on any financial transaction with people or entities in Turkey — were lifted in parallel with the scuttled sanctions against Turkey’s minister of justice, Abdulhamit Gul, and the interior minister, Suleyman Soylu.