Pakistan said Sunday its forces killed at least 50 Afghan troops and destroyed five checkpoints in clashes along the disputed border two days earlier, while Afghanistan dismissed the account, saying only two border police and a civilian were killed.

The two armies traded fire Friday around the Chaman border crossing, which has been closed by Pakistan, stranding people on both sides. The clashes, which ended after a few hours when local commanders contacted each other via an emergency hotline, marked a dangerous escalation between the two U.S. allies.

The two uneasy neighbors share a porous 2,200-kilometer (1,375-mile) border and have long traded allegations of allowing their border regions to be used by militant groups.

Pakistani Maj. Gen. Nadeem Ahmad told reporters at the crossing that two Pakistani soldiers were killed in Friday’s fighting and another nine were wounded. He said around 100 Afghan forces were wounded.

Najib Danish, deputy spokesman for the Afghan Interior Ministry, said that account was “completely baseless.” He said two Afghan border police were killed in Spin Boldak, on the Afghan side of the border, and another 11 were wounded. An Afghan government statement issued Sunday accused Pakistan of “unprovoked firing” Friday and Saturday.

Danish said a woman was killed and 30 other civilians were wounded in the attacks, which forced several local residents to flee their homes.

Pakistani officials said the fighting began after Afghan security forces fired on Pakistani census workers and the troops escorting them, killing nine civilians and wounding 42, including women and children. They say the Afghan government had been notified and given the coordinates of the border villages, where the census workers were going door to door.

Afghan officials said Pakistani troops fired the first shots.

Afghanistan refuses to recognize the so-called Durand Line, established more than a century ago when the British Empire controlled much of South Asia, as the international border. The line runs through the traditional homeland of the Pashtun ethnic group, which dominates Afghanistan and the border provinces of Pakistan.

Afghanistan refuses to allow Pakistan to set up additional border posts, even though the frontier area is used by the Taliban and other Islamic militant groups. Each country says the other turns a blind eye to militant sanctuaries.