Updated

The NATO chief urged the Taliban on Tuesday to stop killing their fellow Afghans, an appeal that came just hours after the insurgents attacked border troops in western Farah province, killing at least 20.

Speaking at a joint press conference with Afghan President Ashraf Ghani, NATO Secretary General Jens Stoltenberg said the "Taliban must realize the war does not benefit anyone."

A resurgent Taliban now hold nearly half of Afghanistan and carry out near-daily attacks on Afghan security forces, inflicting heavy casualties. The Taliban view the U.S.-backed government in Kabul as a dysfunctional Western puppet and have refused repeated offers to negotiate with it.

But Washington and NATO are holding out hope, seeking to find a negotiated exit to 17 years of war.

Speaking alongside Stoltenberg, Ghani said his government hopes "the beginning of formal negotiations is not far."

"The result has to be an inclusive Afghan peace, one that all Afghans accept," he said. To this end, "we support the engagement of our international colleagues."

The remarks of the two stood in sharp contrast to the violence that shakes the nation almost daily.

In western Farah province, the Taliban attacked an Afghan border base on Monday night, killing at least 20 troops and abducting about 20 others.

According to Abdul Samad Salehi, a provincial council member, about 45 border forces were based at the outpost in the Posht Koh district as it was overrun by the Taliban, setting off an hours-long gunbattle. All communication with the base was lost, he said.

Three guards managed to reach a nearby village while the rest were either killed or taken by the Taliban, Salehi said. A senior army official in Farah, who was not authorize to speak to the media, confirmed the casualty figures.

Taliban spokesman Zabihullah Mujahid claimed responsibility for the Farah attack; he also claimed several military vehicles and large amounts of amination were seized.

One of the key demands of the Taliban is that all foreign forces should leave the country.

Stoltenberg said one of the reasons for the high casualties among the Afghan security forces is that they have taken the responsibility for the "security of the entire country."

"There no way I can go back to Europe or to United States, NATO allies and partners and say that it didn't exactly go as we expected, so now we should leave (Afghanistan)," Stoltenberg said. "That will be a total wrong approach; we are here because it is in our interest to be here, to increase our own security."