KABUL, Afghanistan — The Taliban said Sunday they have agreed to a temporary cease-fire nationwide. It provides a window during which a peace agreement with the United States could be signed.

A peace deal would allow Washington to bring home its troops from Afghanistan and end its 18-year military engagement there, America’s longest. The U.S. wants any deal to include a promise from the Taliban that Afghanistan would not used as a base by terrorist groups. The U.S. currently has an estimated 12,000 troops in Afghanistan.

The Taliban chief must approve the agreement but that is expected. The duration of the cease-fire was not specified but it is being suggested it would last for 10 days.

Four members of the Taliban negotiating team met for a week with the ruling council before they agreed on the brief cease-fire. The negotiating team returned on Sunday to Qatar where they maintain their political office.

The Taliban officials familiar with the negotiations spoke on condition of anonymity because they were not authorized to talk to the media.

A key pillar of the agreement, which the U.S. and Taliban have been hammering out for more than a year, is direct negotiations between Afghans on both sides of the conflict.

play_circle_filled Trump thanks troops in Afghanistan, says Taliban want a cease-fire deal President Donald Trump paid a surprise Thanksgiving visit to Afghanistan, where he announced the U.S. and the Taliban have been engaged in ongoing peace talks and said he believes the Taliban want a cease-fire.

Those intra-Afghan negotiations are expected to be held within two weeks of the signing of a U.S.-Taliban peace deal. They will likely decide what a post-war Afghanistan will look like, and what role the Taliban will play. The negotiations would cover a wide range of subjects, such as the rights of women, free speech and the fate of the the tens of thousands of Taliban fighters, as well as the heavily armed militias belonging to Afghanistan’s warlords who have amassed wealth and power since the Taliban’s ouster.

× Fear of missing out? Sign up for the Early Bird Brief - a daily roundup of military and defense news stories from around the globe. Thanks for signing up. By giving us your email, you are opting in to the Early Bird Brief.

The temporary cease-fire had been proposed by U.S. envoy Zalmay Khalilzad during the last round of talks.

THIS IS A BREAKING NEWS UPDATE. AP’s previous story is below.

A Taliban attack in northern Afghanistan killed at least 17 local militiamen, an Afghan official said Sunday.

The attack apparently targeted a local militia commander who escaped unharmed, said Jawad Hajri, a spokesman for the governor of Takhar province, where the attack took place late Saturday.

Local Afghan militias commonly operate in remote areas, and are under the command of either the defense or interior ministries.

Taliban spokesman Zabihullah Mujahid claimed responsibility for the attack.

Airstrikes called in as Taliban attempt to breach Bagram Air Base U.S. and Afghan forces were pulled into a nearly nine to 10 hour firefight after a suicide bombing targeted a medical facility that was under construction near the base, a source on the ground detailed to Military Times.

The attack came even as Taliban officials have told The Associated Press that a temporary nationwide cease-fire may be in the works.

The Taliban have previously refused all offers of a ceasefire by the Afghan government, except for a three-day truce in June 2018 over the Eid al-Fitr holiday.

The current cease-fire proposal would last a week to 10 days. During that time, a peace deal with the United States would then be signed, the Taliban officials said. Talks between Afghans on both sides of the conflict would follow to decide on the shape of a post-war Afghanistan.

The Taliban shura, or ruling council, is currently debating whether to accept the U.S. cease-fire proposal, the Taliban officials said. The officials spoke on condition of anonymity because they were not authorized to speak to the media, but were familiar with the ongoing U.S.-Taliban negotiations.

On Monday, an American soldier was killed in combat in the northern Kunduz province. The Taliban claimed they were behind a fatal roadside bombing that targeted American and Afghan forces in Kunduz.

The following day, a Taliban attack on a checkpoint killed at least seven Afghan army soldiers in the northern Balkh province.

Another six Afghan troops were killed in the same province Thursday in an attack on an army base. At least 10 Afghan soldiers were killed Friday in a complex attack on a checkpoint in the southern Helmand province.

The Taliban frequently target Afghan and U.S. forces, as well as government officials. But scores of Afghan civilians are also killed in the crossfire or by roadside bombs planted by militants.

Associated Press writer Kathy Gannon contributed to this report from Islamabad.