Officials say that thousands of emails between General John Allen and Florida socialite Jill Kelley are flirtatious, but the general denies a relationship. NBC's Andrea Mitchell reports.

Updated 4 p.m. ET: Allegedly “inappropriate” emails between U.S. Gen. John Allen and the woman who sparked the investigation into CIA Director David Petraeus do not signify the two had an affair, a defense official told NBC News on Tuesday.

“There was no affair,” said the official, who spoke on condition of anonymity. The emails in question could be misconstrued, the official said, predicting that the investigation will prove Allen’s innocence.

Allen, the commander of the International Security Assistance Force in Afghanistan, is under investigation over allegations that he exchanged “inappropriate” emails with Jill Kelley, a senior defense official told reporters earlier Tuesday.

A difference of opinion appeared to be brewing at the Pentagon about how to characterize the emails, with another official calling them flirtatious.

Kelley, a Tampa, Fla., woman who has acted as a volunteer “social liaison” with military officials at MacDill Air Force Base, inadvertently launched the investigation that led to Petraeus’ resignation by complaining to the FBI about anonymous emails she received. FBI agents traced the allegedly threatening emails to Paula Broadwell, Petraeus' biographer.

Emails on 'coming and goings' of Petraeus, other military officials escalated FBI concerns

During the investigation, agents discovered emails between Petraeus and Broadwell that were indicative of an extramarital affair between them, according to government and law enforcement officials.

Petraeus, who was appointed 14 months ago to head the Central Intelligence Agency, announced his resignation on Friday, citing an extramarital affair.

Word of the investigation into Gen. Allen’s involvement came early Tuesday, when U.S. Secretary of Defense Leon Panetta issued a statement during a flight to Australia for a meeting with defense officials there, saying that the FBI had referred “a matter involving" Allen to the Department of Defense's Inspector General.

Those who know the two women at the center of General David Petraeus' affair scandal are speaking out. Jill Kelley's brother says she is "dedicated" to her husband, while Paula Broadwell's friend calls her "a pretty great person." NBC's Kristen Welker reports.

“Today, the secretary directed that the matter be referred to the Inspector General of the Department of Defense for investigation, and it is now in the hands of the Inspector General,” Panetta said.

Panetta’s statement did not include specifics, but a senior defense official traveling with him told reporters that Allen “was under investigation for “inappropriate communications” with Kelley.

The official also said the investigation involved some 20,000 to 30,000 pages of material, mostly emails, which were sent from 2010 to 2012, adding that Allen “disputes that he has engaged in any wrongdoing in this matter.”

Later in the day, however, a defense official at the Pentagon told NBC News that the number of emails between Allen and Kelley was inflated.

The FBI eventually discovered that the emails received by Jill Kelley, a close friend of the Petraeus family, were sent by Paula Broadwell. And as they dug deeper, the affair between Broadwell and Petraeus came to light. NBC's Andrea Mitchell reports.

"That is a mischaracterization," said the official, speaking on condition of anonymity. "The communications with General Allen were lumped in with a lot of other email traffic."

The official said that the Allens and Kelleys were "family friends," and the emails were written in that manner. Many of the emails were not personal communications between the general and Jill Kelley, the official added, but included Allen's wife. And many were between Allen's wife and Jill Kelley, with General Allen just copied, the official said.

"What we're dealing with is the possible perception of inappropriateness," the official said, but it will become clear that there was no wrongdoing. "This is not at the level of the director of the CIA."

According to a senior U.S. military official, Pentagon General Counsel Jeh Johnson read "a number" of the emails between Allen and Kelley before he advised Panetta to refer the matter to the Inspector General.

"Leon Panetta didn't make this decision lightly," the official said late Tuesday. The emails were more than just calling one another "sweetheart," characterizing them as flirtatious, the official said.

While the emails may not prove an affair or even be inappropriate, they were unprofessional, the official said.

Allen will meet with investigators over the next few days, but then he is expected to head back to Afghanistan to continue in his role as Commander of ISAF, according to the official.

Panetta’s statement said that Allen would remain commander of ISAF during the investigation and that he was “entitled to due process in this matter.”

But Allen’s nomination to take over as head of U.S. forces in Europe and NATO's Supreme Allied Commander in Europe, was put on hold “until the relevant facts are determined,” Panetta said.

Slideshow: Petraeus case: Cast of characters ISAF via Reuters file Meet the people who have been pulled into the scandal that caused Gen. David Petraeus to resign. Launch slideshow

Allen was in Washington, D.C., preparing for his Senate confirmation hearings which were originally scheduled for Thursday, NBC News reported.

Allen had no advance warning about the investigation, a close aide of Allen’s told NBC News. He was alerted to the probe by the chairman of the Joint Chiefs of Staff, Gen. Martin Dempsey Monday night ET. Allen had a number of meetings scheduled for Tuesday on Capitol Hill, although the aide was unsure if they would take place.

Allen’s connection to the Petraeus investigation also seems to have caught the Defense Department off guard.

“This came as very surprising news, to say the least. No one in the Pentagon is leaping to conclusions just yet,” a senior defense official traveling with Panetta told NBC News. “It's important to review the materials to determine the facts, and it's too early speculate about where this will lead. In the meantime, Gen. Allen needs to focus on the war effort, which he's successfully led since last year.”

The ISAF was also unaware of the investigation until late Monday or early Tuesday, and it declined to comment, in a written statement, referring all questions to the Defense Department.

Allen, a highly decorated officer, took over as ISAF commander in July 2011, and was nominated on Oct. 10 to take over as NATO commander, the same time that his successor at the ISAF was named as Gen. Joseph Dunford.

The confirmation of Dunford, currently assistant commandant of the Marine Corps, is now expected to be fast tracked.

“The secretary has respectfully requested that the Senate act promptly on that nomination," Panetta’s statement said.

NBC News' Courtney Kube, Jeff Black, Ian Johnston and Rachel Elbaum contributed to this report.

Some members of Congress are saying that they or, at the least President Obama, should have been told about the investigation into the director of the CIA while it was going on. NBC's Pete Williams reports.

Related content from NBCNews.com:

Follow US news from NBCNews.com on Twitter and Facebook