The path to The Afghanistan Papers started with Michael Flynn.

In the summer of 2016, as the retired Army general became renowned for his fervent support of GOP presidential nominee Donald Trump, The Washington Post received a tip that Flynn had given a lengthy unpublished interview railing about the war in Afghanistan.

Flynn had granted the interview to staffers from the Office of the Special Inspector General for Afghanistan Reconstruction (SIGAR) as part of its Lessons Learned project. The general had served in the war zone as chief of military intelligence and carried a reputation for speaking his mind. What did he have to say about the longest armed conflict in American history? It seemed like something the public ought to know.

On Aug. 24, 2016, The Post filed a Freedom of Information Act (FOIA) request for a transcript, recordings and other documents from Flynn’s interview. At first, SIGAR staffers were helpful and indicated the records might be released in a few weeks.

Then, on Nov. 8, Trump won the election. Afterward, lawyers for SIGAR would not respond to a reporter’s phone calls and emails. A SIGAR spokeswoman complained she was being kept in the dark by her own agency’s attorneys. “I’m sorry, I’m as frustrated as you by the walls I’ve been hitting,” Jennifer George-Nichol said in an email to a Post reporter.

Weeks passed. On Jan. 24, 2017, Trump announced that Flynn would serve as his national security adviser — a highly influential White House job.

The next day, SIGAR finally reached a decision in The Post’s four-month-old FOIA case. It denied the request for Flynn’s interview materials, citing an exemption in the law that protects government records generated during the “deliberative process.” It did not elaborate.

The denial escalated into a three-year public records battle between The Post and SIGAR that continues to this day.

The fight over the Afghanistan interviews has not set any legal precedents, unlike the Pentagon Papers, the landmark 1971 case in which the Supreme Court upheld the press’s right to publish a secret government study of U.S. involvement in Vietnam. But the two cases share a common theme — a challenge to the government’s attempts to conceal the truth about strategic failures in a faraway war.

The Post’s efforts to obtain the Afghanistan documents also illustrate how difficult it can be for journalists — or any citizen — to pry public information from the government.

The purpose of FOIA is to open up federal agencies to public scrutiny. But officials determined to thwart the spirit of the law can drag out requests for years, hoping requesters will eventually give up.

After SIGAR refused to disclose the Flynn interview records, The Post filed an appeal with the agency, arguing that the denial was legally unjustified and “ultimately harms the public interest.”

The Post also doubled down: In March 2017, it submitted another FOIA request — this time for hundreds of interviews that the inspector general’s staff was believed to have conducted with other key figures in the Afghan war.

In response, SIGAR said that it would look for the interview records but cautioned that it would take time. It granted itself multiple 30-day extensions, and by July 2017 the agency’s FOIA office had stopped responding to a reporter’s emails and phone calls.

In October 2017, The Post sued the inspector general in U.S. District Court in Washington — a step that can cost hundreds of thousands of dollars in legal fees — to obtain the Flynn interview materials. By using the Flynn records as a test case, Post lawyers hoped SIGAR would also disclose the other Afghanistan interviews.

SIGAR reversed itself two months later and released a 10-page, partially redacted transcript of the Flynn interview. It later released an audio recording of Flynn as part of a legal settlement with The Post.

Outside court, the agency also agreed to disclose the hundreds of other interviews. In a January 2018 meeting with a Post reporter, John Sopko, the head of SIGAR, acknowledged the newsworthiness of the interviews, saying that they showed “the American people have constantly been lied to.”

The next month, SIGAR acknowledged that it had conducted more than 400 interviews for its Lessons Learned project and released notes and transcripts from about a dozen of them.

But lawyers for the agency insisted on shielding something else: the names of most of those interviewed. Unlike with the Flynn documents, they said they would keep secret the identities of about 360 people — 90 percent of the total — whom SIGAR had interviewed about the Afghanistan war.

In a February 2018 email, John Arlington, the SIGAR general counsel, said the Inspector General Act of 1978 prohibited the agency from disclosing the identity of anyone it interviewed about the war who wanted to remain anonymous.

“In other words, we have no choice in the matter,” Arlington wrote.

Over the next few months, SIGAR released several dozen additional interviews. But the flow of material soon slowed to a trickle. By the summer of 2018, SIGAR’s lawyers again stopped responding to phone calls and emails from The Post.

In November 2018, The Post filed a second lawsuit against SIGAR in federal court, seeking the interview records that still had not been released.

In response, SIGAR agreed to produce the rest of the interviews, in batches.

But the agency said it needed several months to do so because other federal agencies — including the State Department and Defense Department — needed to review the documents to determine whether anyone had inadvertently disclosed classified information during the Afghanistan interviews. A partial government shutdown in early 2019 led to more delays.

On Jan. 29, U.S. District Judge Amy Berman Jackson gave SIGAR more time to respond but noted The Post’s “justifiable frustration with the pace of the government’s compliance with its FOIA obligations.”

In August, SIGAR released the final batch of documents, bringing the total to 428 interviews.

But SIGAR redacted substantial portions of many of the documents, citing a variety of exemptions under the law. The agency also withheld the names of 366 people it interviewed — White House officials, ambassadors, senior military officials and others.

Justice Department lawyers, representing SIGAR, argued in legal briefs that the people who were interviewed about the war needed to remain anonymous and that they were entitled to privacy protections as whistleblowers, law enforcement informants and consultants. They also contended that those individuals might face humiliation, harassment, retaliation or physical harm if their names became public.

In opposition, lawyers representing The Post argued that the public had a right to know which government officials saw the war as a failure or revealed other misgivings about the 18-year conflict. The Post also argued the war critics were not whistleblowers or informants, because they were not interviewed as part of an investigation.

“It is clear from the interview records that SIGAR has released thus far to the Post that many senior U.S. officials — in sharp contrast to reassuring public statements made by the White House and Pentagon over 18 years — privately viewed the war as an unmitigated disaster,” Charles Tobin of Ballard Spahr, the law firm representing The Post, wrote in a legal brief.

“There is an extraordinarily compelling public interest in disclosing the identity” of government officials and others “who criticized U.S. policy in such frank and forthright terms,” Tobin added. “It matters greatly if the person worked in the White House, at the U.S. military headquarters in Kabul, or in a less visible role.”

The Post is continuing to fight for the names of all those interviewed. A decision by the judge has been pending since late September.

Sopko, the inspector general, declined to comment on the lawsuit last week in an interview with The Post. But he denied that his agency had intentionally delayed the release of the interview records.

“No, no, no — no one’s asked us to slow-roll it and we wouldn’t slow-roll it,” Sopko said. “I think of any inspector general, I’ve probably been the most forthcoming on information. So if the process is slow, I apologize.”