Attorney General William Barr is trying to figure out how the Trump-Russia collusion investigation got started. He may find a more complicated story than he suspects. It may well be that ill-willed FBI and CIA agents working against Trump evolved from a much narrower scheme that targeted Michael Flynn long before Donald Trump brought Flynn on to his team, first as a campaign adviser, and then as head of the national security council.

Life does not run in a straight line, and top officials in the intelligence community long had it in for Flynn, ever since he changed the way we did intelligence against al Qaeda in Iraq, and then against the Taliban and Iranian-supported terrorists in Afghanistan. The changes put both intelligence-gathering and anti-terrorist operations primarily under battlefield control, significantly diminishing the power of Washington-based intel officers. These high-ranking officials remained hostile thereafter, as Flynn moved to the headquarters of national intelligence, and then to the Defense Intelligence Agency.

He was essentially fired from the Defense Intelligence Agency by Director of National Intelligence James Clapper, who told him he should retire. This came on the heels of Flynn’s sworn congressional testimony criticizing the Obama administration’s failed Afghanistan policy. This showed, once again, that Flynn understood how badly we were doing, and would not collude with the intelligence community. Indeed, he intended to carry out an audit of covert funding since the creation of the Central Intelligence Agency (none has been done in all those years).

It was therefore not surprising that Flynn was targeted by top intel officials when he became an adviser to several Republican primary candidates in 2016. If Barr looks at the circumstances of Flynn’s removal from the Defense Intelligence Agency, he will find many of the same people who went after both Flynn and Trump after the election. Indeed, the anti-Trump operation began with accusations from the intelligence community that Flynn was in cahoots with the Russians, and, as national security adviser Susan Rice warned the president-elect, might be in violation of the Logan Act.

Consider, for example, Stefan Halper, a longtime informant in the intelligence community. Halper claimed that Flynn was compromised by the Russians, and six months later Flynn was forced into retirement. Halper was later an informant for the FBI seeking information on the Trump campaign.

I think the operation against Flynn provided the template for much of the anti-Trump campaign, from the “unmasking” of people surveiled by FISA-approved intercepts to the close collaboration with British and Italian intelligence services. When the operation against Flynn succeeded, the operators must have realized that similar methods might bring down the president himself. All the pieces were in place. Their team was formed, their international working relations with foreign counterparts were intact, and when they saw that Trump would not fight for his chosen national security adviser, they reckoned he’d fall victim to the same methods.

Paradoxically, the anti-Trump operation that Barr is now investigating was not created to undo the results of the 2016 election; it was already there. The anti-Trump campaign was an application of the methods of an internal battle within the intelligence community, now directed against the president-elect, and subsequently against the president.

So when did “it” start? I think the attorney general has to consider the very real possibility that there is no “it.” There were two operations, and the one flowed into the other. Both came out of the intelligence community. One succeeded, the second failed. Such is life.

Michael Ledeen is freedom scholar at the Foundation for the Defense of Democracies. He has written 38 books.