KABUL, Afghanistan — The Afghan government on Saturday announced that it was preparing for direct negotiations with the Taliban in the next two weeks, a major step in efforts to end a war so long that it has left record casualties in its wake.

But the Taliban quickly rejected it.

The militant group’s spokesman said the Taliban was steadfast in its refusal to directly negotiate with the Afghan side until the United States announces a schedule for withdrawing the remainder of its 14,000 troops in the country. Analysts questioned the point of the government’s announcement when the Taliban’s position on the withdrawal of U.S. troops was clear all along.

The episode was the latest bit of confusion in a prolonged peace process. The insurgents and the Americans are nearing a deal after seven rounds of protracted negotiations in the Qatari capital of Doha — talks that have excluded the Afghan government. As part of that agreement, expected to be completed soon, the United States and the Taliban would settle on a timeline for the withdrawal of American troops — one believed to be under two years with conditions attached.

But American diplomats, recently aided by Germany and Norway, have struggled to advance the process to its next step, in which the Taliban would negotiate with the Afghan government over the political future of the country after the American-led NATO mission ends its military presence. Afghan and Taliban leaders have yet to meet, except for a recent summit where a small number of officials attended in a personal capacity.