Many of those who met the prime minister complained that the district administration and the state government did not extend to them the kind of support they should have.
"I, Soniaji and Rahul Gandhi have come here to share your grief and to understand the magnitude of the violence," the prime minister told a group of journalists.
"This is a big incident and the culprits behind the incident must be brought to book. It is the government's responsibility to safeguard life and property so that people can again return to their homes."
He said his government would provide all necessary assistance to the Uttar Pradesh government to ensure that victims of the violence got all help.
Speaking to residents of Budhana Road in Muzaffarnagar, the prime minister said: "Please maintain peace and calm."
Both Manmohan Singh and Sonia Gandhi also stopped by the roadside to talk to villagers of Barvala.
The prime minister was all ears as distraught people met him. "I am here to share your pain," he said.