"The Afghan Charge d'Affaires was summoned to the Ministry of Foreign Affairs this morning and a strong protest was lodged, seeking an investigation into the incident and action against those responsible," Foreign Office spokesman Moazzam Khan said.
Khan said the government had taken "serious note of the incident involving 29 Pakistanis who were returning from Afghanistan and were badly beaten en route, reportedly by Afghan forces."
The Pakistanis had "valid travel documents (and) passports," he said.
The Afghan government was asked to take appropriate measures to avoid the recurrence of such incidents.
A similar protest was lodged by Pakistani Ambassador in Kabul with the Afghan government, Khan said.
The incident occurred at the Torkham border crossing, media reports said.
Pakistani forces closed the crossing following the incident.