The closing delayed thousands of people on both sides of the border and slowed the movement of supplies for NATO forces in Afghanistan.
The Torkham border crossing was reopened when the Afghan government pledged to investigate the alleged mistreatment and charge those responsible, the Dawn newspaper in Pakistan reported.
Twenty-nine men said they were lured to Afghanistan by promises of work but they said they were not paid, their passports were destroyed and they were imprisoned and then beaten so badly it amounted to torture.
Pakistan lodged an official protest with Afghan diplomats in Islamabad, Khaama Press reported.
"The Government of Pakistan takes serious note of the incident involving 29 Pakistanis who were returning from Afghanistan and were badly beaten en route reportedly by Afghan forces despite having valid travel documents/passports," the Foreign Office said in a statement on its website.