It was the 12th incident of a girl being abducted, raped and killed in the past year in the district, police said.
Residents have been furious at the authorities for what they see as a failure to investigate such cases.
Ahead of the girl's funeral, protests sparked by her death turned violent. A mob attacked a local police office, throwing stones and some shooting bullets.
Police said in order to stop them they resorted to aerial firing. At least two people were killed, officials said.
Ansari's parents, who were out of the country on a pilgrimage when their daughter was kidnapped, returned on Wednesday.
Her father Ameen appealed for the authorities to do more.
"We are going to try and not bury our child until the issue has been properly resolved," he said.
"We are going to appeal to the chief justice of Pakistan, to the army chief of Pakistan, and everyone that has daughters.
But district police officer Zulfiqar Ahmed defended the police, saying they had done everything they could.
"Over the last four or five days we mounted a search operation to try and find her," he said.
"All the localities of Kasur and abandoned places were searched, but unfortunately we did were not able to find her. Yesterday afternoon her body was found inside the main refuse dump in the city."
'We want the killer alive'
Zainab's uncle, Hafiz Muhammad Adnan, has publicly asked for calm, and called for the murderer to be arrested alive.
"Just to lift the burden off themselves, the authorities shouldn't kill some innocent person and say 'yes we have given you justice'," he said.
"We want the killer alive. And moreover, security should be improved in the area, security cameras need to be installed."
Ansari's case has attracted the attention of the country's civilian and military leadership, with Punjab Chief Minister Shahbaz Sharif calling for immediate action.
The inspector-general of police has been asked to submit a report on Ansari's murder to the court in Punjab.
The army chief has also demanded more resources be assigned to the case, to find those responsible.