The improbable story - by turns tragic and silly - could have major consequences, unfolding at a critical time in the Afghan war effort and just as President Barack Obama was hoping for a smooth transition in his national security team.
Obama put a hold on the nomination of Afghan war chief Allen to become the next commander of U.S. European Command as well as the NATO supreme allied commander in Europe after investigators uncovered 20,000-plus pages of documents and emails that involved Allen and Tampa socialite Jill Kelley. Some of the material was characterized as "flirtatious."
Allen, 58, has insisted he'd done nothing wrong and worked to save his imperiled career.
Gen. Martin Dempsey, chairman of the Joint Chiefs of Staff, has recommended to Defense Secretary Leon Panetta that he keep Allen in his post as commander in Afghanistan, Dempsey's spokesman, Col. David Lapan, said Tuesday.
Dempsey called Allen from Australia, where he was to attend meetings with Panetta, Secretary of State Hillary Rodham Clinton and their Australian counterparts. Allen told Dempsey that he had not committed any wrongdoing, Lapan said.
Kelley, 37, who had worked herself into the center of the military social scene in Florida without having any official role, emerged as a central figure in the still-unfolding story that has embroiled two of the nation's most influential and respected military leaders.
Known as a close friend of retired Gen. Petraeus, Kelley triggered the FBI investigation that led to his downfall as CIA director when she complained about getting anonymous, harassing emails. They turned out to have been written by Petraeus' mistress, Paula Broadwell, who apparently was jealous of the attention the general paid to Kelley. Petraeus acknowledged the affair and resigned Friday.
In the course of looking into that situation, federal investigators came across what a Pentagon official called "inappropriate communications" between Allen and Kelley, both of them married.
According to one senior U.S. official, the emails between Allen and Kelley were not sexually explicit or seductive but included pet names such as "sweetheart" or "dear." The official said that while much of the communication - including some from Allen to Kelley - is relatively innocuous, some could be construed as unprofessional and would cause a reasonable person to take notice.
That official, as well as others who described the investigation, requested anonymity on grounds that they were not authorized to discuss the situation publicly.
The FBI decided to turn over the Allen information to the military once the bureau recognized it contained no evidence of a federal crime, according to a federal law enforcement official, who was not authorized to discuss the matter on the record and demanded anonymity. Adultery, however, is a crime under the Uniform Code of Military Justice.
A senior defense official said that the FBI first notified the Pentagon of the Allen matter at 4:15 p.m. EST on Sunday. The Pentagon's top lawyer, Jeh Johnson, then called Panetta's chief of staff, Jeremy Bash, about 5 p.m. as Bash and Panetta were flying to Honolulu aboard a military jet to begin a weeklong Asia trip. Bash then informed Panetta.
Allen was not suspended from his military position, even though his nomination for promotion is on hold. The White House will soon be deciding how many troops will remain in Afghanistan - and for what purposes - after the U.S.-led combat operation ends in 2014. Allen has provided his recommendations to the White House and is key to those discussions.
Still more subplots in the story emerged Tuesday with news that both Allen and Petraeus wrote letters last September on behalf of Jill Kelley's twin sister, Natalie Khawam, in a messy custody dispute. In 2011, a judge had denied Khawam custody of her 3-year-old son, saying she "appears to lack any appreciation or respect for the importance of honesty and integrity in her interactions with her family, employers and others with whom she comes in contact."
Allen, in his letter, wrote of Khawam's "maturity, integrity and steadfast commitment to raising her child." Petraeus wrote that he'd been host for the Kelley family and Khawam and her son for Christmas dinner, and he described a loving relationship with her son. That also indicated how close the Petraeus and Kelley families had been.
Kelley served as a sort of social ambassador for U.S. Central Command in Tampa, hosting parties for Petraeus when he was commander there from 2008-10.
The friendship with the Petraeus began when they arrived in Tampa, and the Kelleys threw a welcome party at their home, a short distance from Central Command headquarters, introducing the new chief and his wife, Holly, to Tampa's elite, according to staffers who served with Petraeus.
Such friendships among senior military commanders and prominent local community leaders are common at any base, a relationship where the officers invite local people to exclusive military events and functions, and the invitees respond by providing private funding to support troops with everything from morale-boosting "Welcome Home" parades to assistance for injured combat veterans.
Petraeus aides say Jill Kelley took it to another level, winning the title of "honorary ambassador" from the countries involved in the Afghan war for her extensive entertaining at her home on behalf of the command, throwing parties that raised her social status in Tampa through the reflected glow of the four-star general in attendance.
Petraeus even honored Kelley and her husband with an award given to them in a special ceremony at the Pentagon just before he left the military for his post at the CIA, an aide said, speaking on condition of anonymity because he was not authorized to comment on the matter publicly.
White House spokesman Jay Carney, employing understatement, was asked about the revelations involving Allen and said Obama "wouldn't call it welcome" news. Carney described Obama as "surprised" by the earlier news about Petraeus.
As he prepares for a second term, the president has hoped to run a methodical transition process, with the goal of keeping many Cabinet members and other high-ranking officials in their posts until successors are confirmed, or at least nominated. Petraeus' resignation has disrupted those plans, leaving Obama with an immediate vacancy to fill and raising questions about how much other immediate shake-up the national security team can handle.
National Security Council spokesman Tommy Vietor said Obama put Allen's nomination on hold at the request of Panetta. The general succeeded Petraeus as the top American commander in Afghanistan in July 2011 and has been working with Panetta on how best to pace the withdrawal of U.S. troops.
Vietor said in a written statement that Obama "remains focused on fully supporting our extraordinary troops and coalition partners in Afghanistan, who Gen. Allen continues to lead as he has so ably done for over a year."
The unfolding story caused a commotion on Capitol Hill as well, as lawmakers complained that they should have been told about the investigation earlier.
Rep. Peter King, R-N.Y., chairman of the House Homeland Security Committee, called the latest revelations "a Greek tragedy."
Acting CIA Director Michael Morell met with Senate Intelligence Committee Chairwoman Dianne Feinstein, D-Calif., and ranking Republican Saxby Chambliss of Georgia on Tuesday, to explain the CIA's understanding of events that led Petraeus to resign. That session came ahead of meetings with the leaders of the House Intelligence Committee on Wednesday, according to congressional aides.
The chairman and top Republican on the Senate Armed Services Committee said their panel would go ahead with Thursday's scheduled confirmation hearing on the nomination of Marine Corps Gen. Joseph Dunford, who is to replace Allen as commander of U.S. and NATO forces in Afghanistan, if Allen is indeed promoted.
Even though Petraeus has stepped down, Sen. Carl Levin, chairman of the Armed Services Committee, said the retired general should testify about the Sept. 11 attack on the U.S. Consulate in Benghazi, Libya, "if he has relevant information." Sen. Susan Collins, R-Maine, said it was "absolutely imperative" that Petraeus testify, since he was CIA director during the attack and visited Libya afterward.
Asked by reporters if there was a national security breach with the Petraeus affair, Feinstein said: "We're going to hold an inquiry. We're going to look at things. I have no evidence that there was at this time." She said she expected Petraeus to testify - "if not this week, then another week. That's for sure."
Feinstein said did not believe that either Allen or Petraeus would release classified information.
The FBI looked into whether a separate set of emails between Petraeus and Broadwell might involve any security breach and concluded it did not.
The FBI searched Broadwell's home in Charlotte, N.C., Monday night, with her consent, according to a federal law enforcement official, who requested anonymity because the official was not authorized to speak on the record about the investigation.
The official said the FBI just wanted to make sure there were no classified documents out of government custody.
Associated Press writers Lolita Baldor, Pete Yost, Kimberly Dozier, Adam Goldman, Jack Gillum, Larry Margasak, Julie Pace, Donna Cassata and Robert Burns contributed to this report.