See more of the story

– President Donald Trump publicly contradicted a major policy position of his own administration for the second time in a week on Thursday, during a period when his stability and grasp of details have come under renewed fire.

In the latest incident, Trump sent a tweet that rattled the national security community and lawmakers from his own party, nearly derailing a vote in the House to renew the National Security Agency’s broad authority to collect surveillance of foreigners, without warrants, including those communicating with U.S. citizens. Though it passed the House 256-164, the extension still faces uncertainty in the Senate, where Kentucky Sen. Rand Paul, a Republican, has threatened a filibuster.

The House vote was preceded by chaotic debate over an issue that has split lawmakers into unusual bipartisan alliances since former NSA contractor Edward Snowden’s disclosure of the scope of the eavesdropping program in 2013. A competing measure, which would have required additional privacy protections for Americans, was rejected.

Trump added to the chaos early Thursday, insisting angrily and contrary to all known evidence that the program was used to spy on his campaign during the 2016 election. The tweet, sent hours before the already contentious vote, prompted concern from the program’s supporters, including House Speaker Paul Ryan, who called the president to discuss the program, according to a person familiar with the call who requested anonymity. Trump issued a second tweet, more supportive of the surveillance authority, after his talk with Ryan.

It was a striking contradiction between Trump’s dueling identities as a man often guided by impulses, grievances and what he sees on television, and Trump the president, responsible for taking a broader view of government and security issues.

Trump also contradicted his administration’s policy on Tuesday during a public meeting with lawmakers at the White House to discuss immigration. During the meeting, Trump said he would agree to sign a stand-alone bill extending legal protections to immigrants who came to the U.S. illegally as children. Trump also had to walk that statement back after lawmakers reminded him that his own White House was insisting such protections would only be agreed to in exchange for a host of other changes to immigration law.

The Thursday tweets had Republican lawmakers at a private meeting listening to real-time updates on the president’s stream-of-consciousness, with at least one tweet read aloud by Rep. Devin Nunes, the California Republican and chairman of the House Intelligence Committee who authored the surveillance bill extension, who showed his phone to the House majority leader, according to lawmakers and others familiar with the private meeting.

“It was funny,” said Rep. Tom Cole, R-Okla. “He is a rookie … but that’s one of the reasons the American people chose him.”

Chief of Staff John Kelly has tried to calm reactions from White House staffers to such incidents, telling reporters in November, after Trump provoked North Korean leader Kim Jong Un, that he has instructed staffers to avoid reacting to Trump’s Twitter postings. But on Thursday, he found himself in the Capitol just ahead of the vote he and other administration officials had been lobbying for.

“It’s not more difficult. It’s a juggling act,” Kelly told a CNN reporter.

Trump’s tweet about the NSA program came on the same morning that “Fox & Friends,” a frequent inspiration for Trump’s tweets, aired a segment in which Judge Andrew Napolitano, a commentator, offered scathing criticism of the surveillance program.

“Mr. President, this is not the way to go,” he said, looking at the camera.

That may have been what prompted Trump to tweet a claim that the program had been abused.

“This is the act that may have been used, with the help of the discredited and phony Dossier, to so badly surveil and abuse the Trump Campaign by the previous administration and others?” Trump wrote.

More than an hour later the president reversed course.

“With that being said, I have personally directed the fix to the unmasking process since taking office and today’s vote is about foreign surveillance of foreign bad guys on foreign land. We need it! Get smart!”

The political fallout, though, was already underway, and the House floor debate quickly turned as critics of the legislation seized on the president’s comments.

Rep. Adam Schiff, the top Democrat on the Intelligence Committee, went to the House floor to urge Republicans to postpone the vote after the “inaccurate, conflicting and confusing statements.”

“All of us were in turmoil this morning in the wake of the president’s tweets, which threw the whole proceedings into disarray,” he said later. “When the first tweet came out, all of us were imagining the expletives that were flying in the intelligence community, let alone the Cabinet. Someone obviously prevailed on the president to issue a tweet to clean up the mess caused by the first one.”