Sargodha Deputy Commissioner Liaquat Ali Chatta said the incident took place at the dargah (shrine) of Muhammad Ali Gujjar in a village in Sargodha district, some 200 km from Lahore, at around midnight yesterday.
The custodian Abdul Waheed, who was apparently suffering from mental disease, used a dagger and a stick to kill his victims, he said.
Chatha said it appeared that the caretakers of the dargah had first drugged the visitors, stripped them and then stabbed and clubbed 20 people, including three women, to death.
"We have taken five people, including the caretakers of the dargah -- Waheed and Yousuf, into custody for interrogation," Chatha said.
More From This Section
Three persons, including two women, have been injured.
They have been shifted to hospital where their condition is stated to be critical.
People would come to the dargah for "cleansing" their sins and allow the caretakers to beat them with clubs.
He said that the prime suspect, a resident of Lahore, is an employee of the Election Commission of Pakistan.
According to senior police officer Bilal Iftikhar, one injured witness also said there was a clash between two groups of the caretakers of the dargah over its possession.
Twenty people of both groups, including six members of one family, were killed, the police officer said.
"We have launched an investigation into all aspects of this case to ascertain the facts of this gory incident," Iftikhar said.