Petraeus resigned as CIA director last week.
Allen, a four-star Marine general, succeeded Petraeus as the top American commander in Afghanistan in July 2011.
The senior official, who discussed the matter only on condition of anonymity because it is under investigation, said Panetta believed it was prudent to launch a Pentagon investigation, although the official would not explain the nature of Allen's problematic communications.
The official said 20,000 to 30,000 pages of emails and other documents from Allen's communications with Kelley between 2010 and 2012 are under review. He would not say whether they involved sexual matters or whether they are thought to include unauthorized disclosures of classified information. He said he did not know whether Petraeus is mentioned in the emails.
"Gen. Allen disputes that he has engaged in any wrongdoing in this matter," the official said. He said Allen currently is in Washington.
Panetta said that while the matter is being investigated by the defence Department Inspector General, Allen will remain in his post as commander of the International Security Assistance Force, based in Kabul. He praised Allen as having been instrumental in making progress in the war.
The FBI's decision to refer the Allen matter to the Pentagon rather than keep it itself, combined with Panetta's decision to allow Allen to continue as Afghanistan commander without a suspension, suggested strongly that officials viewed whatever happened as a possible infraction of military rules rather than a violation of federal criminal law.
Allen was Deputy Commander of Central Command, based in Tampa, prior to taking over in Afghanistan. He also is a veteran of the Iraq war.
In the meantime, Panetta said, Allen's nomination to be the next commander of US European Command and the commander of NATO forces in Europe has been put on hold "until the relevant facts are determined." He had been expected to take that new post in early 2013, if confirmed by the Senate, as had been widely expected.
Panetta said President Barack Obama was consulted and agreed that Allen's nomination should be put on hold. Allen was to testify at his confirmation hearing before the Senate Armed Services Committee on Thursday. Panetta said he had asked committee leaders to delay that hearing.
Panetta also said he wants the Senate Armed Services Committee to act promptly on Obama's nomination of Gen. Joseph Dunford to succeed Allen as commander in Afghanistan. That nomination was made several weeks ago. Dunford's hearing is also scheduled for Thursday.
- AP