DOHA, Qatar (AP) — The Taliban signaled a willingness to meet demands to keep their flag lowered as the U.S. warned Saturday that their newly opened political office in Qatar might have to be closed as talks aimed at ending nearly 12 years of war in Afghanistan remained in limbo.

U.S. Secretary of State John Kerry said the ball was in the Islamic militant movement’s court, urging the Taliban to step back from the brink and begin what he called the “difficult” road ahead. He said the main U.S. envoy for Afghanistan and Pakistan was in Doha and “waiting to find out whether the Taliban will respond.”

The Taliban’s office opened Tuesday to much fanfare and a simultaneous announcement that U.S. officials would begin formal talks with Taliban representatives, which eventually would be joined by the Afghan government raised hopes that the long-stalled peace process aimed at ending Washington’s longest war could finally begin. But it ran into trouble from the outset when Afghan President Hamid Karzai temporarily withdrew from talks to protest the Taliban’s use of its old flag and a sign bearing the name of the Islamic Emirate of Afghanistan, which the movement used during its five-year rule that ended in 2001 with the U.S.-led invasion.

After intervention from the Qatar government, the flag was lowered and the sign changed to the “Political Bureau of the Taliban Afghan in Doha.” Both the U.S. and the Qataris said the Taliban had agreed on the pre-approved name but violated the pact at the ribbon cutting ceremony.

A Taliban spokesman in Doha, Shaheen Suhail, suggested the Taliban were willing to move forward despite “much anger” among some members over the removal of the name and the lowering of the Taliban flag — a white flag emblazoned with a Quranic verse in black.

“In the past 12 years, the opening of the political office is the first ray in the direction of peace in Afghanistan,” Suhail said. “Those who want real peace in the county should support this move. These are the first days. There should not be high expectations to see everything resolved in one day, nor should there be disappointments.”

He told The Associated Press in a telephone call that the U.S. had not contacted the Taliban yet to discuss a meeting.

James Dobbins, U.S. special envoy to Afghanistan and Pakistan, arrived in Doha on Saturday.

Kerry, in the Qatari capital for separate talks on Syria’s civil war, said the Americans and the Afghan government’s High Peace Council were ready, and he encouraged the Taliban to remain in the process.

“Nothing comes easily in this endeavor, we understand that. The road ahead will be difficult, no question about it, if there is a road ahead,” he said at a press conference, adding “it’s really up to the Taliban to make that choice.”

“It remains to be seen in this very first test whether or not the Taliban are prepared to do their part,” he said.

Suhail for the first time suggested the Taliban were willing to discuss a cease-fire, as well as the presence of U.S. troops in Afghanistan to train Afghan security forces after the end of the NATO combat mission in 2014. He even agreed to the rights of women being on the table, a nod to fears among women, mostly in Afghanistan’s cities, that the Taliban would reinstate restrictive rules such as the mandatory wearing of the all- encompassing burqa. While most women in Afghanistan still wear the burqa, it was law during the Taliban rule. They also did not allow girls to attend school, which they have also backed away from.

“Yes there should be a cease-fire but first you have to talk about how to reach a cease-fire. How can it be done in one day?” he asked. “It can be part of the agenda and discussed, also foreign troops in Afghanistan can be part of the agenda, the general concern of the Afghan people, of the Afghan women can all be part of the agenda. It is only when this process goes forward can we make progress.”

The Taliban earlier said they have agreed to free U.S. Army Sgt. Bowe Bergdahl — a 27-year-old Hailey, Idaho, native who was captured four years ago June 30 in Afghanistan — in exchange for five Taliban prisoners being held in the U.S. prison in Guantanamo Bay, Cuba.

In Kabul, a member of the government’s negotiation team said it was still prepared to begin talks in Qatar and called the removal of the sign and flag was a positive sign.

High Peace Council member Shahzada Shahid said it was too early to say when members of the council would travel to Qatar for talks. “Peace is very important and vital for us so we will take all measures for it,” he said.

Meanwhile on the battlefield, 18 Taliban militants were killed Saturday when they attacked a local security post in northern Afghanistan, sparking fighting that also left two Afghan policemen dead, Afghan officials said.

A militant attack also killed a coalition service member in the south on Saturday, NATO said. The statement did not provide a nationality or further details.