On Tuesday morning, the country’s spy chiefs filed into an ornate meeting room on Capitol Hill to testify at the Senate Intelligence Committee’s annual hearing on the threats currently facing the United States. Dan Coats, an affable former Republican senator from Indiana, who is the director of National Intelligence; Gina Haspel, a career C.I.A. covert operative who now leads that agency; and Christopher Wray, a former federal prosecutor, who is now the head of the F.B.I., shook hands with the senators and became the focus of attention.

In the course of two hours, the three officials delivered carefully measured testimony that included pronouncements that would seemingly please the President. “While we were sleeping in the last decade and a half,” Coats said, “China had a remarkable rise in capabilities.” Wray concurred, noting that China has “blurred if not erased” the “line between lawful behavior and fair competition and lying and hacking and cheating and stealing.” And Haspel said that the Saudi journalist Jamal Khashoggi was the victim of “premeditated murder” but declined to state whether Saudi Arabia’s crown prince Mohammed bin Salman was personally responsible.

But the three chiefs also quietly but clearly disagreed with the President. Coats stated that North Korea was “unlikely to completely give up its nuclear weapons and production capabilities,” contradicting Trump, who has claimed that it might. Wray said that the Russians had used social media to try to interfere in the 2018 midterm elections, and were “continuing to adapt their model,” contradicting skeptical comments that Trump has made about Russia’s involvement. And Haspel said that Iran was technically “in compliance” with the nuclear deal that it had struck with the Obama Administration, contradicting claims by Trump that it is violating the terms of that agreement.

Midway through the hearings, news alerts that the intelligence chiefs were openly contradicting Trump’s assertions started hitting mobile phones and television screens. On Wednesday morning, Trump was furious after seeing cable-television news headlines saying that the intelligence chiefs had contradicted him, according to CNN, and he attacked them in two tweets, without having seen their full testimony. “The Intelligence people seem to be extremely passive and naive when it comes to the dangers of Iran. They are wrong!” Trump tweeted. “Perhaps Intelligence should go back to school!” (On Thursday afternoon, Trump tweeted a photo of himself meeting with Coats and Haspel in the Oval Office. He suggested that people read the “COMPLETE” testimony from the hearing, and blamed the media for putting out a “false narrative.”)

That twenty-four-hour cycle—from a two-hour hearing to two angry tweets—was the latest charged interaction in the fraught relationship between Trump and the intelligence agencies. In an unprecedented act for a sitting President, Trump has repeatedly accused members of the F.B.I. and other agencies of being part of a “deep state” that is trying to oust him from power. His critics say that he is blatantly pressuring the intelligence community to politicize intelligence by producing findings that match his political goals—mirroring a process that was blamed, in part, for the faulty intelligence assessments that helped lead to the invasion of Iraq during the George W. Bush Administration. But the President may also be trying to achieve something simpler: bullying the intelligence agencies into silence.

On Tuesday, James Clapper, who served as the director of National Intelligence during the Obama Administration, told me that the agency heads had spoken “truth to power,” which, he said, is the primary duty of intelligence officers. He also praised them for presenting their findings without flaunting their disagreements with the President. “I think that what happened today is proof positive that the intelligence community, two years into Trump’s term, is still doing its job,” he said.

Current and former intelligence officials warned that, within the community, Trump’s rancor is having an impact. Over all, one current senior official said, the community has “hunkered down” to stay focussed on the mission, and senior members try to avoid getting in the President’s cross hairs. The senior official told me that the leaders “of these agencies are exhorting their troops to ignore the political swirl,” telling them to “just get on with your job.” But there is a growing sense that the President and his inner circle are rejecting intelligence assessments that disagree with their views. A former senior intelligence official told me that Mike Pompeo, Trump’s former C.I.A. director and now the Secretary of State, gave analysts “a lot of real pushback” when they told him, in briefings, that Iran was complying with the nuclear agreement. Trump has reportedly taken issue with intelligence briefers on this topic as well.

In 2017, after transcripts of Trump’s conversations with several foreign leaders leaked to the press, intelligence-agency employees were required to attend seminars in which they were instructed on the damage caused by leaks. “With this President, the political pressure to go after leakers was incredible,” the former official said. More broadly, current and former officials say that a sense of caution has taken hold. Officials often take painstaking efforts to insure that none of their actions can be interpreted as being political—by Trump’s supporters or by his opponents—and that they will not somehow be penalized for their actions in the future. The current senior official said that this caution has not yet resulted in self-censorship within the agencies. “People are extra careful to be nonpolitical,” the official said. “People are doing what they’re doing, they’re just dotting every ‘I’ and crossing every ‘T.’ ”

Yet the former official believes that the feeling that the President and his advisers may dismiss the community’s findings is resulting in a rote production of intelligence. “There is a certain sense of people going through the motions and doing things for the record,” that official told me, because “if the President isn’t interested in the intelligence there is little incentive to go above and beyond and think outside of the box.” The implicit risk is that the community could fail to anticipate the emergence of new threats, as it has been accused of doing before 9/11 and during the 2016 election.

Clapper, however, disagreed with this assessment, saying that, for now, he doesn’t think that the analysts have succumbed to political pressure. “I imagine now they are going to be very careful when they’re writing about Russia, or North Korea’s nuclear program,” he said. “I’m sure they’re still writing that stuff. Institutionally, there are too many checks and balances.”

Trump’s efforts to pressure the agencies are particularly unusual, though, because they are public. C.I.A. analysts said that Bush Administration officials accused them of trying to sabotage the President’s policies when they questioned intelligence reports that Saddam Hussein had weapons of mass destruction, but the Administration did so in private. Clapper said that Obama never commented, publicly or privately, about testimony that Clapper gave before Congress. “He never said, ‘I’d like you to soft-pedal this, or not that say that.’ Not once.”

The current and former officials, as well as Clapper, told me that they are most concerned about the long-term impact of the President’s claims that the F.B.I. and C.I.A. are part of the deep state. They worry that such statements will fuel a decline in the willingness of Americans to work for intelligence agencies. “The whole gutting of the institution” is possible, the former official said. “What kind of talent will we attract in the future? That is a huge concern.”

Clapper said that he isn’t sure the community can withstand the political pressure in the long term. But, he said, for now, it is performing as it should. “Intelligence people are mindful of history. ‘How will what I write be reflected in the history books? Did I continue to tell the truth?’ The intelligence community will continue to speak truth to power even when the power ignores the truth.”