WASHINGTON — A Pentagon investigation has cleared Gen. John Allen, the top U.S. commander in Afghanistan, of professional misconduct in exchanging emails with a civilian woman linked to the sex scandal that led retired Gen. David Petraeus to resign as CIA director.

Pentagon press secretary George Little said Tuesday that Defense Secretary Leon Panetta was informed of the conclusion by the Pentagon’s inspector general.

“The secretary was pleased to learn that allegations of professional misconduct were not substantiated by the investigation,” Little said, adding that Panetta has “complete confidence in the continued leadership” of Allen.

The matter had been referred to the Pentagon in November by the FBI during the course of its investigation of emails between Petraeus and his biographer-turned-paramour, Paula Broadwell. The FBI turned up thousands of emails between Allen and Jill Kelley, who was said to have received threatening emails from Broadwell.

At the time, officials said 20,000 to 30,000 pages of emails and other documents from Allen’s communications with Kelley between 2010 and 2012 were in question. None of the emails have been made public.

Shortly after hearing from the FBI, Panetta referred the matter to the Pentagon’s inspector general. He expressed confidence in Allen, leaving him in charge of all allied forces in Afghanistan.

Allen’s nomination to be the next U.S. commander of NATO forces in Europe was put on hold, and remains there.