Marine Corps Gen. Joseph F. Dunford testifies at a Senate Armed Services Committee hearing on Nov. 15. (JASON REED/REUTERS)

Marine Gen. Joseph F. Dunford, tapped by President Obama to become his fifth commander of the war in Afghanistan, will take charge in Kabul early next year, Pentagon officials said Tuesday.

Dunford, currently the assistant commandant of the Marine Corps, was confirmed for his new post by the Senate in a voice vote Monday night. As the commander of U.S. and NATO forces in Afghanistan, he will succeed another Marine, Gen. John R. Allen, whose future is in flux because of a pending investigation into his “potentially inappropriate” communications with a Tampa woman.

U.S. officials said Allen’s travails are unlikely to force the Pentagon to accelerate its original plan for Dunford to assume command in February. They said that U.S., NATO and Afghan officials are trying to finalize a date for a change-of-command ceremony in Kabul, but that they expected Allen to remain in the job several more weeks.

The Pentagon’s investigation into Allen’s relationship with Jill Kelley, a Florida woman who befriended several generals and admirals at the U.S. Central Command headquarters in Tampa, has come at a particularly awkward moment for the military.

The White House is scheduled to make a final decision in the next few weeks on some critical mileposts for winding down the war. Rather than rush Dunford into his new position, however, Obama and Defense Secretary Leon E. Panetta have chosen to keep Allen in command until early next year, despite the investigation by the Pentagon’s inspector general.

Allen is in the midst of finalizing his recommendations to Obama on how quickly to withdraw troops from Afghanistan next year, and he recently presented options on how many U.S. trainers and counterterrorism forces might remain in the country after 2014, when the NATO-led combat mission is scheduled to end.

Allen’s longer-term future in the military remains uncertain. Obama had chosen him to become NATO’s supreme allied commander in Europe, but the White House froze his nomination last month pending the outcome of the investigation.

Panetta asked the Defense Department’s inspector general last month to review between 20,000 and 30,000 documents and e-mails that Allen and Kelley had exchanged since 2010.

The communications were unearthed by the FBI as part of a separate investigation into an affair between former CIA director David H. Petraeus and his biographer, Paula Broadwell. Petraeus publicly admitted the affair and abruptly resigned last month.

Associates of Allen and Kelley have denied that they had an affair, and details of the e-mails between them remain secret at the Pentagon.