During the presidential race, Flynn campaigned vigorously for Republican nominee Donald Trump and drew attention for his scalding attacks against Democratic opponent Hillary Clinton for mishandling classified material.
Clinton was investigated by the FBI for allowing classified information to be transmitted on her private email server when she ran the State Department. No charges were filed against the former Secretary of State, but the issue dogged her for more than a year.
At the Republican National Convention in July, Flynn called on Clinton to drop out of the race for putting "our nation's security at extremely high risk with her careless use of a private email server". He egged on the partisan crowd in chants of "lock her up," adding: "If I, a guy who knows this business, if I did a tenth, a tenth of what she did, I would be in jail today".
Flynn did not respond to requests for comment.
The office of the Army's Judge Advocate General released a four-page summary of the investigation into Flynn in response to the Post's Freedom of Information Act request for records of any misconduct allegations involving the retired three-star general.
The US military opened the investigation into Flynn in 2010 after receiving a complaint from an unnamed Navy intelligence specialist, according to the documents. The intelligence officer charged that Flynn violated rules by "inappropriately" sharing secrets with "various foreign military officers and/or officials in Afghanistan".
The documents do not reveal the nature of the information. But former US officials familiar with the case said it focused on slides and other materials containing classified information about CIA operations in Afghanistan.
"It was a general intelligence briefing that included stuff that shouldn't have been on those slides," said a former senior US intelligence official, who, like others, spoke on the condition of anonymity, citing the sensitivity of the subject. The disclosures revealed "stuff the intelligence community was doing that had a much higher level of classification".
The agency has had an extensive presence in the Afghanistan since the September 11, 2001, attacks. Beyond gathering intelligence on al-Qaeda and the Taliban, the CIA has also assembled its own paramilitary networks in the country, paying warlords for cooperation and funding armed groups known as Counterterrorism Pursuit Teams.
A second former US official said Flynn failed to secure permission to reveal those secrets. "This was a question of whether or not information was put through proper channels before it was shared," the second official said.
The episode marked the second time in a year that Flynn had drawn official complaints for his handling of classified material.
Former US officials said that Flynn had disclosed sensitive information to Pakistan in late 2009 or early 2010 about secret US intelligence capabilities being used to monitor the Haqqani network, an insurgent group accused of repeated attacks on US forces in Afghanistan.
Flynn exposed the capabilities during meetings with Pakistani officials in Islamabad. The former US intelligence official said a CIA officer who accompanied Flynn reported the disclosures to CIA headquarters, which then relayed the complaint to the Defence Department. Flynn was verbally reprimanded by the Pentagon's top intelligence official at the time, James Clapper.
Clapper subsequently became director of national intelligence and endorsed Flynn to become his successor as director of the Defence Intelligence Agency. In 2014, however, Clapper forced Flynn out of that job over concerns with his temperament and management.
The newly disclosed Army documents state that the 2010 investigation was ordered by the head of US Central Command, which oversees military operations in the Middle East and Afghanistan. Although the records do not say exactly when the case was opened, the commander at the time would have been Marine General James Mattis.
Mattis took charge at Central Command's headquarters in Tampa, Florida, in August 2010. One month later, Flynn was ordered back to Washington from Afghanistan. He was assigned to a temporary job at the Pentagon as the special assistant to the Army's chief of intelligence while the investigation unfolded, records show.
Mattis was nominated this month by Trump to serve as secretary of defence. In that role, Mattis will work closely with Flynn; the retired generals are expected to be the most influential voices on national security in the Trump administration.
The Army documents that summarize the investigation into Flynn do not specify which countries he was accused of improperly sharing secrets with. In an interview with the Post in August, Flynn said he was scrutinised for giving classified information to British and Australian officials serving in Afghanistan alongside US forces.
In that interview, Flynn defended his actions and said he did nothing wrong. "That was substantiated because I actually did it. But I did it with the right permissions when you dig into that investigation. I'm proud of that one. Accuse me of sharing intelligence in combat with our closest allies, please."
The Army documents, however, state explicitly that the Central Command investigation determined that Flynn did not have permission to share the particular secrets he divulged. The Defence Department's inspector general, which conducted an independent review of the investigation, came to the same conclusion, the documents show.
It is routine for the US military to share intelligence in Afghanistan with Nato allies such as Britain, as well as other members of the broader international coalition fighting the Taliban and al-Qaeda, including Australia. But there are established mechanisms and guidelines that must be followed.
Flynn was highly regarded within the Army for the key role he played in shaping US counterterrorism strategy in Iraq and Afghanistan. Pentagon officials had intended to promote Flynn in 2010 to the rank of lieutenant general and to make him assistant director of national intelligence, a job that would place him in charge of improving ties with foreign intelligence agencies.
The Central Command investigation delayed his career advancement for a full year. He received his promotion and new assignment in September 2011.
After being forced to retire from the military in 2014, Flynn became a vocal opponent of the Obama Administration's policies regarding Iran and al-Qaeda. At the same time, he gained a reputation for floating conspiracy theories on Twitter.
Some Democratic lawmakers have criticised his selection as Trump's national security adviser. The position is not subject to Senate confirmation.