ISLAMABAD, Pakistan — The U.S. Embassy in Islamabad apologized on Wednesday after saying that its official Twitter account had been used without permission to retweet an anti-Trump post from a Pakistani opposition politician and rival of Prime Minister Imran Khan.
“The U.S. Embassy Islamabad Twitter account was accessed last night without authorization,” the American diplomatic mission said in a message on Twitter. “The U.S. Embassy does not endorse the posting or retweeting of political messages,” the post added. “We apologize for any confusion that may have resulted.”
The opposition politician who was retweeted, Ahsan Iqbal, is a former federal minister who is a member of the opposition Pakistan Muslim League-Nawaz party. On Tuesday night, Mr. Iqbal posted an image of a Washington Post headline, “Trump’s defeat is a blow to world’s demagogues and dictators,” with the comment: “We have one in Pakistan too. He will be shown way out soon,” referring to Mr. Khan, the prime minister.
The U.S. Embassy’s account retweeted Mr. Iqbal’s message, causing an uproar on social media in Pakistan. The hashtag #ApologiseUSembassy was trending on Twitter in the country on Wednesday, when the retweet was deleted. There was no immediate indication that the account had been hacked, but the embassy declined to comment further.
Members of the governing party, Pakistan Tehreek-e-Insaf, denounced the embassy’s forwarding of Mr. Iqbal’s message, calling it an act of interference in local politics. Several Pakistani officials said that an apology was not enough.
Shahbaz Gill, a special assistant to Mr. Khan on political communication, said on Twitter, “We expect some heads must roll.”
Opposition politicians in Pakistan seemed to relish the furor.
“The embassy account mistake was only echoing the writing on the wall and will ultimately be recorded as prophetic,” said Daniyal Aziz, a former lawmaker with Pakistan Muslim League-Nawaz.
The political environment in Pakistan has been particularly turbulent recently, with opposition parties holding countrywide rallies in an attempt to oust Mr. Khan, arguing that the country’s powerful and influential military propelled him unfairly to victory in the 2018 general elections.
Opposition lawmakers have also accused Mr. Khan of political victimization after several leading figures were targeted in recent months over what they have called spurious allegations of corruption.
The military has denied accusations of meddling in politics, while Mr. Khan says his moves against opposition politicians stem from an election promise to root out graft.
The retweet by the American Embassy ruffled feathers not least because of the outsize influence the United States is reputed to wield in Pakistan. Many in the country joke that there are three factors that decide a government’s fate: Allah, army, and America. U.S. diplomats say the extent of American sway is exaggerated.
The Trump administration has had an up-and-down relationship with Mr. Khan’s government. In 2018, President Trump tweeted that Pakistan’s leaders “take our money and do nothing for us,” referring to efforts to combat terrorism, and his administration froze security aid to the country.
But Mr. Trump has since had outwardly friendly relations with Mr. Khan, who visited him in the Oval Office the next year and has received one of the president’s highest compliments — being called “very popular.”
Mr. Trump was motivated to try to cool tensions in part to win Pakistan’s help in supporting peace talks to end the war in Afghanistan, which has been one of his chief foreign policy goals.
Some Pakistani opposition politicians have been quick to share past pictures of themselves with President-elect Joseph R. Biden Jr., who visited the country numerous times as vice president, and have expressed hope that the new U.S. administration might exert more pressure on Pakistan on issues such as human rights and freedom of the press.
Michael Crowley contributed reporting from Washington.