For several years in the Syrian War, a CIA program saw US and Saudi-acquired weapons smuggling into Syria, nominally for the “moderate rebels.” The program was ultimately scrapped this year, and had been criticized because the “moderates” never amounted to much.

But studies from Conflict Armament Research set about to find out what happened to these arms shipments. In many cases, the weapons wound up in the hands of the ISIS movement, and served as a source for some of their most advanced armament.

The biggest source of weapons ISIS had was looting the Iraqi and Syrian militaries, though in the case of Iraq this was basically the same result, as the US provided materially all the weapons for Iraqi forces as well.

The weapons in large measure were made in the European Union, with purchases mostly coming out of Eastern European nations like Bulgaria to try to avoid scrutiny. The CIA made this an incredibly efficient smuggling route, though where the arms ended up after they arrived at the Syrian border appears to have been a big blind spot.

Arms not made in the EU came mostly out of Russia and China. Russian arms largely were looted from the Syrian military, which used Russia as their primary supplier, while the Saudis at times purchased missiles from China to send to the rebels.

This lossage to ISIS included some very advanced armaments, including a 9M111B missile, a powerful anti-vehicle missile which the CIA smuggled into Syria in December 2015. By February of the next year, ISIS already had at least one such missile.

The rapidity of ISIS getting such advanced arms out of the other rebels was particularly noteworthy, researchers say, because it suggests there were not many intermediaries between the “moderates” the US thought they were arming and the ISIS fighters they were actually arming.

That Islamists were beneficiaries of the US arms smuggling program was never really in doubt, but the scope to which they were, and that ISIS was in particular, is extremely embarrassing for the program, and raises questions why the smuggling kept going for so long.