President Trump has understandable reasons for distrusting the U.S. intelligence community, according to a former CIA official who led the agency under former President Barack Obama.

Mike Morell, who served as acting director of the CIA from 2012-2013, took some of the blame for Trump’s feud with the CIA. Morell lamented that he failed to consider how Trump would consider his endorsement for Democratic presidential nominee Hillary Clinton, especially when paired with other officials’ criticisms and a series of unflattering leaks.

“And [Trump] could rightfully have said, ‘Huh, what’s going on with these intelligence guys?’ Right?” Morell told Politico’s Susan Glasser. “So, I think there was a significant downside to those of us who became political in that moment. So, if I could have thought of that, would I have ended up in a different place? I don’t know. But it’s something I didn’t think about.”

Morell endorsed Clinton in August of 2016, citing Trump’s lack of qualifications and willingness to exchange compliments with Russian President Vladimir Putin.

“In the intelligence business, we would say that Mr. Putin had recruited Mr. Trump as an unwitting agent of the Russian Federation,” he wrote in a New York Times op-ed. “My training as an intelligence officer taught me to call it as I see it. This is what I did for the C.I.A. This is what I am doing now. Our nation will be much safer with Hillary Clinton as president.”

That was Morell’s first foray into domestic politics, “a difficult decision” that he allowed was made easier by the expectation that Clinton would win. But the accumulation of Morell’s criticisms, along with former CIA director Michael Hayden and then-CIA director John Brennan, likely left a bad impression with Trump.

“Then he becomes president, and he’s supposed to be getting a daily brief from the moment he becomes the president-elect,” Morell said. “Right? And he doesn’t. And within a few days, there’s leaks about how he’s not taking his briefing. So, he must have thought—right?—that, ‘Who are these guys? Are these guys out to get me?’”

Trump has a better relationship with current CIA director Mike Pompeo, a former Republican lawmaker who joined the Trump administration in January. Pompeo’s coziness with the president has drawn fire from some critics who worry that he might politicize the CIA, but Morell praised his approach to the job.

“I think that the relationship that Mike Pompeo has developed with the president is a very good thing,” he said. “I think that is a very good thing. And one of the things that folks at CIA feel really good about is the fact that their director is getting them in the room every day.”