KABUL (Reuters) - Taliban militants killed at least 14 members of a pro-government militia in Afghanistan on Wednesday, said officials, as Taliban and U.S. officials near a deal aimed at ending the 18-year war.

Government officials said 14 members of the militia were killed and several civilians were wounded during clashes in the western province of Herat.

Abdul Ahad Walizada, a spokesman for Herat police, said the 14 were killed after a large number of Taliban fighters stormed security checkpoints in the Chahardara area.

“At least nine others are wounded in the clashes and the Taliban militants were pushed back after Afghan forces reinforced the area,” said Walizada.

Taliban officials were not immediately available for a comment.

U.S. and Taliban officials are said to be nearing an agreement, after months of negotiations, under which the United States would start to withdraw troops from Afghanistan in exchange for Taliban pledges not to allow the country to be used by international militants plotting attacks abroad.

The Taliban on Wednesday said they are set to reach a “final agreement” with the United States to end 18 years of war in Afghanistan that began when they were ousted from power following the Sept. 11, 2001, attacks on the United States.

It is not clear if the agreement will include a ceasefire between the Taliban and forces of the U.S.-backed government, or if the Taliban will promise to open power-sharing talks with the government.

The Taliban have refused to talk to the government, which they see as a U.S. puppet.

Despite the talks between the Taliban and the United States, a senior Afghan interior ministry official said government forces along with thousands of pro-government militia members were battling the militants across at least 10 of the country’s 34 provinces.

“The Taliban consider pro-government militia forces a big threat because they have strong intelligence networks, often both sides know each other’s families,” said a second senior security official in Kabul, requesting anonymity.

This week, Taliban fighters killed nine pro-government militia members, including a district commander, Baz Mohammad, in the Jawzjan province in the north, officials said.

The commander’s son is a member of the Taliban in the area, said a relative who is also a provincial council member.

Eight Taliban fighters were also killed in the clashes.

The government, with the support of international forces, has over the years set up militias in the countryside to fight the Taliban, with more than 30,000 villagers paid and armed under the program, according to security officials.

But in 2017, the government decided to disband the militias and stopped making payments to them. Their numbers dwindled but many maintained their fight against the Taliban and more recently Islamic State.

Three militia commanders interviewed by Reuters in recent weeks said they were willing to surrender their arms and stop fighting if the Taliban vowed to end the war.

“I hope there will be nationwide amnesty after the peace deal, and no one will think about the past, we are all tired of fighting,” said Saheb Khan, commander of a militia in Jawzjan province.