KABUL, Afghanistan  Talks to end the war in Afghanistan involve extensive, face-to-face discussions with Taliban commanders from the highest levels of the group’s leadership, who are secretly leaving their sanctuaries in Pakistan with the help of NATO troops, officials here say.

The discussions, some of which have taken place in Kabul, are unfolding between the inner circle of President Hamid Karzai and members of the Quetta shura, the leadership group that oversees the Taliban war effort inside Afghanistan. Afghan leaders have also held discussions with leaders of the Haqqani network, considered to be one of the most hard-line guerrilla factions fighting here; and members of the Peshawar shura, whose fighters are based in eastern Afghanistan.

The Taliban leaders coming into Afghanistan for talks have left their havens in Pakistan on the explicit assurance that they will not be attacked or arrested by NATO forces, Afghans familiar with the talks say. Many top Taliban leaders reside in Pakistan, where they are believed to enjoy at least some official protection.

In at least one case, Taliban leaders crossed the border and boarded a NATO aircraft bound for Kabul, according to an Afghan with knowledge of the talks. In other cases, NATO troops have secured roads to allow Taliban officials to reach Afghan- and NATO-controlled areas so they can take part in discussions. Most of the discussions have taken place outside of Kabul, according to the Afghan official.