The classified intelligence that President Trump disclosed in a meeting last week with Russian officials at the White House was provided by Israel, according to a current and a former American official familiar with how the United States obtained the information. The revelation adds a potential diplomatic complication to the episode.

Israel is one of the United States’ most important allies and a major intelligence collector in the Middle East. The revelation that Mr. Trump boasted about some of Israel’s most sensitive information to the Russians could damage the relationship between the two countries. It also raises the possibility that the information could be passed to Iran, Russia’s close ally and Israel’s main threat in the Middle East.

Israeli officials would not confirm that they were the source of the information that Mr. Trump shared. In a statement emailed to The New York Times, Ron Dermer, the Israeli ambassador to the United States, reaffirmed that the two countries would maintain a close counterterrorism relationship.

“Israel has full confidence in our intelligence-sharing relationship with the United States and looks forward to deepening that relationship in the years ahead under President Trump,” Mr. Dermer said.

In the meeting with the Russian ambassador and foreign minister, Mr. Trump disclosed intelligence about an Islamic State terrorist plot. At least some of the details that the United States has about the plot came from the Israelis, the officials said.

The officials, who were not authorized to discuss the matter and spoke on the condition of anonymity, said that Israel previously had urged the United States to be careful about the handling of the intelligence that Mr. Trump discussed.

Mr. Trump said on Tuesday on Twitter that he had an “absolute right” to share information in the interest of fighting terrorism and called it a “very, very successful meeting” in a brief appearance later Tuesday at the White House alongside President Recep Tayyip Erdogan of Turkey. Lt. Gen. H. R. McMaster, Mr. Trump’s national security adviser, told reporters that he was not concerned that information sharing among intelligence partners would stop.

“What the president discussed with the foreign minister was wholly appropriate to that conversation and is consistent with the routine sharing of information between the president and any leaders with whom he’s engaged,” General McMaster said at a White House briefing, seeking to play down the sensitivity of the information Mr. Trump disclosed.