President Trump publicly contradicted a major policy position of his administration Thursday — the second time he did so in a week in which the White House has sought to beat back questions about his stability and grasp of policy details.
The incident provided a new and striking example of the contradiction between Trump's dueling identities as an individual 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.
The events began Thursday morning when Trump sent a tweet that rattled the national security community and Republican lawmakers, nearly derailing a vote in the House on one of the administration's top national security priorities — renewing the National Security Agency's broad authority to conduct surveillance of foreigners, without warrants, including those communicating with U.S. citizens.
The bill eventually passed the House, 256-164, but only after Speaker Paul D. Ryan and others intervened with Trump, prompting him to send a second tweet that partially walked back his earlier criticism of the surveillance law. The extension of surveillance authority still faces uncertainty in the Senate, where Kentucky Sen. Rand Paul, a Republican, has threatened a filibuster.
Trump's initial tweet insisted, angrily and contrary to all known evidence, that the NSA's surveillance program might have been used to spy on his campaign during the 2016 election.
"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.
The tweet came shortly after "Fox & Friends," Trump's favorite program and a frequent inspiration for his Twitter account, aired a segment in which 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.
White House officials would not say whether Napolitano's comment prompted Trump's tweet.
After talking to Ryan, Trump issued a second tweet, more supportive of the surveillance authority:
"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 White House, in an official statement released Wednesday night, had explicitly warned lawmakers of the need for the bill, arguing that an alternative pushed by critics on both the right and left would undermine "the useful role FISA's Section 702 authority plays in protecting American lives." The House rejected that amendment Thursday, 183-233.
The tweets had Republican lawmakers at a private meeting listening to real-time updates on the president's stream of consciousness. Rep. Devin Nunes (R-Tulare), the chairman of the House Intelligence Committee and chief sponsor of the bill to extend surveillance authority, read Trump's second tweet aloud to the group.
Nunes showed his phone to House Majority Leader Kevin McCarthy (R-Bakersfield), according to lawmakers and others familiar with the private meeting.
"It was funny," said Rep. Tom Cole (R-Okla.). " 'Be smart' got lots of laughs."
"He is a rookie," Cole said. "But that's one of the reasons the American people chose him."
Chief of Staff John F. Kelly has tried to calm reactions from White House staffers to such incidents, telling reporters in November, after Trump wrote provocative tweets about North Korean leader Kim Jong Un, that he has instructed staffers to avoid reacting to Trump's Twitter account.
On Thursday, Kelly was in the Capitol, along with Marc Short, the White House legislative director, just ahead of the vote for which administration officials had been intensely lobbying.
"It's not more difficult. It's a juggling act," Kelly told a CNN reporter.
White House Press Secretary Sarah Huckabee Sanders, asked later about Trump's tweets, gamely insisted, "We don't think that there was a conflict at all."
The tweeting incident was the second time this week that Trump publicly differed from his administration's position on a major issue.
On Tuesday, during a televised White House meeting with lawmakers to discuss immigration, Trump said he would agree to sign a stand-alone bill extending legal protections to so-called "Dreamers," the roughly 700,000 immigrants who came to this country illegally as children.
Trump had to walk that statement back after McCarthy reminded him that the White House was insisting such protections could be agreed to only in exchange for a host of other changes to immigration law.
On Wednesday, Trump contradicted a statement he made in June, when he said he would agree "100%" to sit down with special counsel Robert S. Mueller III to discuss the probe into potential collusion with Russia during the election and possible subsequent obstruction of justice.
"We'll see what happens," Trump said in a news conference Wednesday, adding that he would speak with his attorneys while declining to reaffirm his prior promise.
In the House on Thursday, the floor debate quickly turned contentious as critics of the surveillance legislation seized on the president's comments. The debate split lawmakers into unusual bipartisan alliances, which frequently have stymied legislative action on surveillance since former NSA contractor Edward Snowden disclosed the scope of the eavesdropping program in 2013.
A coalition of liberal Democrats and conservative Republicans was pushing an alternative bill that would have limited the NSA's power and established additional privacy protections for Americans, requiring intelligence agencies to go to court for a warrant before getting most information on U.S. citizens.
"Get a warrant," said Rep. Ted Poe (R-Texas). "Let's redraft it and protect Americans."
Democrats seized on Trump's remarks as reason to put off the entire debate.
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."
Authority for the surveillance program was set to expire at the end of last year, but Congress agreed to a temporary extension, though mid-January, to give lawmakers more time to debate reforms. Under the House bill, the surveillance program would be extended through 2023.
12:30 p.m.: This article was updated with additional detail on Trump's tweets and the House debate.