Donald Trump on Tuesday defended his decision to share certain sensitive information with Russian officials in the Oval Office last week, undermining the credibility of his own staff, including Secretary of State Rex Tillerson and national security adviser H.R. McMaster, who just hours before had carefully denied such reports.

Trump tweeted that he had “the absolute right” to share information “pertaining to terrorism and airline flight safety” with Russia. He said he shared such information for “humanitarian reasons” and in order to force Russia to “greatly step up their efforts to fight ISIS and terrorism.”

On Monday the Washington Post reported that Trump divulged classified details about an ISIS terrorist plot involving laptops on airplanes during a meeting with Russian Foreign Minister Sergei Lavrov and Russian Ambassador Sergei Kislyak. The information had been shared with the U.S. intelligence community by an ally on the basis that it was not shared with others. The Post said Trump also revealed the city within Islamic State group territory where the ally found out about the threat — prompting some to suggest that the informant’s life had been put in danger.

The report was subsequently confirmed by the New York Times, The Wall Street Journal, Reuters, and BuzzFeed. While the disclosures have shocked many and raised serious concerns about intel-sharing arrangements, technically Trump has done nothing illegal, as the president has broad constitutional powers allowing him to declassify information at will.

Trump’s tweets seem to counter the message White House officials had been giving reporters just hours earlier. National security adviser H.R. McMaster, who was in the room during the meeting, said late on Monday: “The story that came out tonight, as reported, is false.”