WASHINGTON — President Obama on Friday pushed back against persistent speculation in Turkey that the United States was behind the failed military coup there, saying that the rumors threatened the safety of Americans in the country and could damage its ties with the United States.

“Any reports that we had any previous knowledge of a coup attempt, that there was any U.S. involvement in it, that we were anything other than entirely supportive of Turkish democracy are completely false, unequivocally false,” Mr. Obama said at a news conference at the White House.

The president said he had impressed that message on President Recep Tayyip Erdogan when the two spoke by telephone on Tuesday. A few days earlier, Turkey’s labor minister, Suleyman Soylu, who is close to Mr. Erdogan, told a television station that “America is behind the coup.” The rumors have been fueled by the fact that a Turkish cleric, Fethullah Gulen, whom Turkey’s leaders accuse of being the coup’s puppet master, is living in self-imposed exile in Pennsylvania.

The president’s remarks were his most extensive and strongly worded response to the anti-American sentiment that has bubbled up in Turkey since the coup attempt plunged the country into turmoil. But Mr. Obama was more circumspect in responding to Mr. Erdogan’s wholesale purge after the coup, a reflection of the delicacy of the president’s approach to a country that is a NATO ally and a critical partner in the campaign against the Islamic State.