The protesters destroyed computers, iris checking machines, furniture and a UN High Commissioner for Refugees (UNHCR) vehicle in the "sudden" anger late on Wednesday in Peshawar near the Afghan border, office chief Yaris Khan said.
Khan said police had to disperse the crowd of between 300 and 600 at the registration centre, which is processing thousands of refugees who have been ordered to leave Pakistan by mid-September.
"They did not give us any reason," he said.
But local police officer Usman Ali Shah said the riot happened after the wooden roof of a makeshift shed collapsed after heavy rains, injuring eight refugees including some women and children.
Refugee Jalat Khan, who is waiting for his papers to be processed so he can return to the eastern Afghan city of Jalalabad, said the attackers had come from a nearby camp at Kachha Garhi to help out those in the queue.
"They reacted because they had seen their compatriots had been waiting for travel documents in hot weather for the past several days," he said.
"They reacted because they had seen their compatriots had been waiting for travel documents in hot weather for the past several days"
"Our brothers vented their anger in our support."
Afghan Consul-General Abdul Khaliq visited the centre on Thursday and asked the refugees to stay calm.
Refugees have arrived from different camps across Pakistan to pass through the registration centre in Peshawar, where they must undergo iris validation tests to stop them coming back through the porous border with Afghanistan.
"We have decided to let all those who are already at the centre go back to their country without iris testing," the UNHCR's Khan said. "This is being done because of the unusual situation triggered by the attack."
Officials said about 1000 Afghans left the site early on Thursday and the situation was now under control.
A dozen policemen guarded the site on Thursday while UNHCR staff collected the damaged equipment.
Around three million Afghans still live in Pakistan.
Many have lived there for years, having fled the Soviet occupation in the 1980s.
Pakistan has ordered the closure of all refugee camps in its semi-autonomous tribal regions because of security concerns.
Around three million Afghans
still live in Pakistan
It originally gave a 31 August deadline but it has since given them until 15 September.
In a separate incident in the tribal areas on Thursday, armed men hijacked an official van and took hostage its two occupants including a paramilitary soldier in Wana, the main town in the South Waziristan tribal agency.
Also, three Pakistan soldiers were injured on Thursday when a remote controlled roadside bomb exploded and hit a military convoy near Miranshah, the main town of neighbouring North Waziristan.
Pakistan recently sent in 9500 extra troops to seal the border ahead of Afghanistan's landmark parliamentary elections on 18 September.