The top U.S. commander in Afghanistan is now under investigation for what is being described as “inappropriate communication” between the general and a woman implicated in the scandal swirling around former CIA director David Petraeus.

In a statement released overnight, U.S. Defense Secretary Leon Panetta revealed that Gen. John Allen is now the subject of an internal investigation by Pentagon officials.

He will keep his job as commander of the International Security Assistance Force (ISAF), "while the matter is under investigation and before the facts are determined," Panetta said.

"He is entitled to due process in this matter."

An unnamed Pentagon official told The Associated Press that between 20,000 and 30,000 pages of emails and other communications between Allen and Jill Kelley are under review. Beyond "inappropriate communications," it is unclear what investigators are searching for in the documents, most of which span the period of 2010 to 2012.

One senior U.S. official, who requested anonymity on grounds that they were not authorized to discuss the situation publicly, said the emails between Allen and Kelley were relatively innocent, not sexually explicit or seductive, and included pet names such as “sweetheart” and “dear.”

Kelley and her husband are friends of Petraeus and his wife, Holly, due to Kelley’s volunteer work as a social planner at U.S. Central Command in Florida, where both generals had previously served.

Allen could face charges if he is found to have had a relationship with Kelley, as adultery is a crime under the Uniform Code of Military Justice.

The 58-year-old commander insists he has done nothing wrong.

Gen. Martin Dempsey, chairman of the Joint Chiefs of Staff, has recommended to Panetta that Allen retain his post in Afghanistan, said Dempsey spokesperson Col. David Lapan on Tuesday.

Lapan said Dempsey called Allen from Australia, where he was to meet with Panetta and Secretary of State Hilary Rodham Clinton. Allen told Dempsey he had not done anything wrong.

Kelley was the recipient of threatening emails from Paula Broadwell, the 40-year-old woman with whom Petraeus, 60, admitting to having an extramarital affair.

Petraeus resigned from his job at the CIA on Friday.

FBI agents raided Broadwell's Charlotte, North Carolina home on Monday, spending approximately four hours in the residence before leaving with several boxes.

In a White House statement Tuesday morning, National Security spokesperson Tommy Vietor said, at Panetta's request, Allen's nomination to become the next commander of the U.S. European Command and the commander of NATO forces in Europe has been put on hold.

Panetta had also asked that the Senate act quickly on the president's nominee to succeed Allen in Afghanistan.

Allen took over the job as top U.S. commander in Afghanistan from Petraeus in July 2011.

Panetta said he has asked his Inspector General to handle the internal investigation after the U.S. Department of Defense was notified about the FBI probe into the Petraeus-Broadwell affair on Sunday.

Senior Senate Armed Services Committee members and the House Armed Services Committee have also been informed of the investigation, he said.

Meanwhile, court documents obtained by The Associated Pressed showed that both Petraeus and Allen intervened in a custody dispute last September involving Kelley’s twin sister Natalie Khawam.

Both men, who met Khawam through Kelley’s work at CENTCOM, wrote letters in support of Khawam, describing her as a loving mother who should not be subject to strict visitation stipulations regarding her son.

Despite their pleas, a judge awarded Khawam’s ex-husband custody of their child, and ordered Khawam to pay her ex-husband’s legal bills. She filed for Chapter 7 bankruptcy in the spring.

Timeline issues

In addition to its probe of communications between Gen. Allen and Kelley, the FBI is also working on a timeline of its Petraeus investigation for Congress.

At issue is the timing of when the White House learned of the Bureau's interest in the former CIA director's conduct.

Senate Intelligence Committee chairwoman Dianne Feinstein, D-Calif., for example, has complained she only learned about the agency’s concerns from the media late last week. She confirmed the investigation in a phone call to Petraeus on Friday, the same day President Barack Obama accepted the retired four-star general's resignation.

U.S. federal law enforcement officials, speaking on condition of anonymity, told The Associated Press that its criminal investigation began in May, after Kelley alerted an FBI agent in Tampa, Fla., to the harassing emails she had received.

Investigators traced the alleged cyber harassment to Broadwell, and in that process uncovered her relationship with Petraeus.

The two had been communicating, they say, by reading unsent messages left in a shared web-based email account.

FBI agents subsequently discovered sensitive documents on Broadwell's computer, but were assured by the general they had not come from him and had perhaps been shared by other U.S. commanders she had interacted with while working as a journalist in Afghanistan.

As a reserve Army major in military intelligence, Broadwell had previously been granted a high security clearance. It was not in effect, however, when she was working on the biography "All In: The Education of General David Petraeus," because she was not on active duty at that time.

According to an anonymous federal law enforcement official, the FBI had concluded by late summer that there was no risk of a security breach in the Petraeus affair.

FBI Director Robert Mueller and Attorney General Eric Holder were both informed of the FBI's suspicions around that time, while Obama's director of national intelligence, James Clapper, was apprised on Nov. 6, the day Americans went to the polls.

Law enforcement officials said Monday that although both Petraeus and Broadwell were interviewed about the affair more than once in recent weeks -- with the latest coming in the days just before the U.S. election -- it is standard practice to withhold details of criminal investigations from the government.

The Petraeus-Broadwell romance is said to have ended in a mutual agreement four months ago, although the two kept in contact regarding a dissertation the married mother of two was still writing.

With files from The Associated Press