After retired Lt. Gen. Michael J. Flynn spoke at the Republican National Convention, The Washington Post captured the prevailing media view of Flynn in the headline: “He was one of the most respected intel officers of his generation. Now he’s leading ‘Lock her up’ chants.”

Now that President-elect Donald Trump has chosen Flynn as his national security adviser, media coverage has given prominence to the more serious issue of Flynn’s denunciation of Islam as a “cancer” and other manifestations of his embrace of Islamophobia. But the mainstream media view of Flynn’s military record ignores his pivotal role in devising a targeting scheme that was the basis for an indiscriminate Joint Special Operations Command (JSOC) campaign of killing and incarcerating Afghans suspected of being in the Taliban insurgency. The corporate media, which have never examined that dark chapter in the history of the Afghanistan war critically, have long treated the campaign as one of the few success stories of the war.

But as an investigation published by Truthout in 2011 revealed, the target list that JSOC used for its “night raids” and other operations to kill supposed Taliban was based on a fundamentally flawed methodology that was inherently incapable of distinguishing between Taliban insurgents and civilians who had only tangential contacts with the Taliban organization. And it was Flynn who devised that methodology.

The “night raids” on Afghan homes based on Flynn’s methodology caused so much Afghan anger toward Americans that Gen. Stanley A. McChrystal, the US commander in Afghanistan, acknowledged the problem of Afghan antagonism toward the entire program publicly in a March 2010 directive.

The system that led to that Afghan outrage began to take shape in Iraq in 2006, when Flynn, then-intelligence chief for JSOC, developed a new methodology for identifying and locating al-Qaeda and Shia Mahdi Army members in Iraq. Flynn revealed the technologies used in Iraq in an unclassified article published in 2008.

At the center of the system was what Flynn called the “Unblinking Eye,” referring to 24-hour drone surveillance of specific locations associated with “known and suspected terrorist sites and individuals.” The drone surveillance was then used to establish a “pattern of life analysis,” which was the main tool used to determine whether to strike the target. We now know from reports of drone strikes in Pakistan that killed entire groups of innocent people that “pattern of life analysis” is frequently a matter of guesswork that is completely wrong.

Flynn’s unclassified article also revealed that “SIGINT” (signals intelligence), i.e., the monitoring of cell phone metadata, and “geo-location” of phones were the other two major tools used in Flynn’s system of targeting military strikes. JSOC was using links among cell phones to identify suspected insurgents.

Flynn’s article suggested that the main emphasis in intelligence for targeting in Iraq was on providing analysis of the aerial surveillance visual intelligence on a target to help decide in real time whether to carry out a strike on it.

But when McChrystal took command of US forces in Afghanistan in mid-2009 and took Flynn with him as his intelligence chief, Flynn’s targeting methodology changed dramatically. JSOC had already begun to carry out “night raids” in Afghanistan – usually attacks on private homes in the middle of the night – and McChrystal wanted to increase the tempo of those raids. The number of night raids increased from 20 per month in May 2009 to 90 per month six months later. It reached an average of more than 100 a month in the second half of 2009 and the first half of 2010.

At this point, the targets were no longer Taliban commanders and higher-ups in the organization. They included people allegedly doing basic functions such as logistics, bomb-making and propaganda.

In order to rapidly build up the highly secret “kill/capture” list (called the “Joint Prioritized Effects List,” or JPEL) to meet McChrystal’s demands for more targets, Flynn used a technique called “link analysis.” This technique involved the use of software that allowed intelligence analysts to see the raw data from drone surveillance and cell phone data transformed instantly into a “map” of the insurgent “network.” That “map” of each network associated with surveillance of a location became the basis for adding new names to the JPEL.

Flynn could increase the number of individual “nodes” on that map by constantly adding more cell phone metadata for the computer-generated “map” of the insurgency. Every time JSOC commandos killed or captured someone, they took their cell phones to add their metadata to the database. And US intelligence also gathered cell phone data from the population of roughly 3,300 suspected insurgents being held in the Afghan prison system, who were allowed to use mobile phones freely in their cells.

What the expansion of cell phone data surveillance meant was that an ever-greater proportion of the targets on Flynn’s “kill/capture list” were not identified at all, except as mobile phone numbers. As Matthew Hoh, who served as the senior US civilian official in Zabul Province until he quit in protest in September 2009, explained to me, “When you are relying on cell phones for intelligence, you don’t get the names of those targeted.”

What made Flynn’s methodology for expanding the kill/capture list even riskier was that there was no requirement for any effort to establish the actual identity of the targets listed as cell phone numbers in order to guard against mistakes.

Using such a methodology in the Afghan sociopolitical context guaranteed that a high proportion of those on the kill/capture list were innocent civilians. As former deputy to the European Union special representative to Afghanistan Michael Semple (one of the few genuine experts in the world on the Taliban movement) explained to me, most Afghans in the Pashtun south and east of Afghanistan “have a few Taliban commander numbers saved to their mobile phone contacts” as a “survival mechanism.”

Nader Nadery, a commissioner of the Afghanistan Independent Human Rights Commission in 2010, estimated that the total civilian deaths for all 73 night raids about which the commission had complaints that year was 420. But the commission acknowledged that it didn’t have access to most of the districts dominated by the Taliban. So the actual civilian toll may well have been many times that number – meaning that civilians may have accounted for more than half of the 2,000 alleged “Taliban” killed in JSOC’s operations in 2010.

The percentage of innocent people among those who were captured and incarcerated was even higher. In December 2010, the US command in Afghanistan leaked to a friendly blogger that 4,100 “Taliban” had been captured in the previous six months. But an unclassified February 5, 2011, internal document of the Combined Joint Inter-Agency Task Force responsible for detention policy in Afghanistan, which I obtained later in 2011, showed that only 690 Afghans were admitted to the US detention facility at Parwan during that six-month period. Twenty percent of those were later released upon review of their files. So alleged evidence of participation in the Taliban insurgency could not have existed for more than 552 people at most, or 14 percent of the total number said to have been captured. But many of those 552 were undoubtedly innocent as well.

Michael Flynn’s role in the JSOC’s killing and capturing of Afghans in 2009 and 2010 earned him a promotion to lieutenant general in September 2011, and the following April, President Obama nominated him to become director of the Defense Intelligence Agency. Those rewards might give us the impression that he did a splendid job in Afghanistan.

In reality, however, Flynn committed serious offenses against Afghans and against the interests of all Americans. His actions should have been a bar to holding the position he has now been given. Instead, it appears, he has been rewarded once again for his role in creating a system of indiscriminate murder in Afghanistan.

Gareth Porter, an investigative historian and journalist specializing in US national security policy, received the UK-based Gellhorn Prize for journalism for 2011 for articles on the U.S. war in Afghanistan. His new book is Manufactured Crisis: the Untold Story of the Iran Nuclear Scare. He can be contacted at porter.gareth50@gmail.com.

Reprinted from TruthOut with the author’s permission.