Cows, which are considered holy by India's majority Hindu population, have become a flashpoint in India in recent years. There have been a string of attacks by hardline Hindu groups targeting Muslims and low-caste Dalits over cattle slaughter and beef consumption.
Anand Kumar, Additional Directer General for Law and Order, said in Lucknow that trouble started after villagers found some body parts of cows in a jungle in Mahaw village.
"There were around 400 people from three neighboring villages".
In the scuffle that erupted between the cops and the unknown protestors a the police inspector, Subodh Verma of Shyana police station got killed said the Civil Lines (Aligarh) police official. Police baton-charged and tried to bring the situation under control.
Police told the BBC that some members of the mob were armed with homemade revolvers and opened fire first.
Police arrested four people on Tuesday and were hunting for a Bajrang Dal activist in connection with mob violence here that left an inspector and a passerby dead, as angry families demanded action amid criticism of the UP chief minister and suggestions of conspiracies. "They continued to fire, broke the official wireless set and burnt government and private property in the police chowki", Chandra has said.
Our correspondent says incidents of violence over alleged cow slaughter are not uncommon in this region, but a direct attack on the police is unprecedented.
Many states, including Uttar Pradesh, have started enforcing bans on cow slaughter since the Hindu nationalist Bharatiya Janata Party came to power in 2014.
Modi has condemned the attacks and promised tough action against the perpetrators, but opposition leaders accuse the BJP governments - federal and in various states - of indirectly supporting the cow vigilantes.
The mob in Chigrawati, according to eyewitnesses and police officers, quickly grew to include more than 300 people as those from nearby villages also joined in. Kumar said more than a dozen cars were set alight.
"When we reached, we saw that a crowd had gathered due to the cow slaughter incident". Some carry life sentences for transgressions.
A young man was also killed in violence but the circumstances leading to his death are not clear.
Uttar Pradesh Chief Minister has announced a financial assistance of Rs 40 lakh to the wife of Subodh Kumar Singh and Rs 10 lakh to his parents.
In two prominent cases previous year, a dairy farmer was murdered on a highway for transporting cows and a Muslim teenager accused of carrying beef was stabbed to death on a crowded train. An agitator was also killed in the violence after which the mob went on the rampage and indulged in arson and destruction at Chingrawati outpost. The incident sparked outcry and protests across the whole country.