KABUL, Afghanistan — Violence has intensified in recent months across Afghanistan as the opposing sides in the war try to turn battlefield blows into gains in negotiations over the country’s political future.

An agreement between the Taliban and the United States is expected to be finalized soon and provide a schedule for the conditional withdrawal of the remaining 14,000 American troops and their NATO partners. In return, the Taliban have pledged to prevent terrorist attacks against the United States and its allies from Afghan soil.

But as the talks continue, the violence worsens. On Wednesday, a powerful Taliban truck bomb exploded outside a police station in Kabul, the Afghan capital, killing 14 people and injuring at least 145 others as peace negotiations between the militants and American diplomats were underway.

The United Nations said July was the deadliest month in Afghanistan in the last couple of years, with 1,500 civilians killed or wounded.