NEW DELHI (Reuters) - Police in India are investigating whether a deadly protest over the alleged slaughter of a cow, an animal many Hindus consider sacred, was aimed at sparking religious tension during a Muslim gathering.

Monday’s violence in the country’s most populous state of Uttar Pradesh, which killed two people, brings back to the national spotlight a trend of cow vigilantism by hardline Hindu groups ahead of a general election due in less than six months.

Police have arrested four of 27 men named in a complaint after a police officer and a man were killed in the northern state’s district of Bulandshahr as tens of thousands of Muslims gathered for a religious event.

Police would try to determine the age of the cow carcass, police official Anand Kumar said when asked if there had been a conspiracy to vitiate the atmosphere by using a dead cow brought in from elsewhere.

“If there was anything like that, then the details will come out,” Kumar, the state’s second highest police official, told a news conference. “There’s an intelligence investigation and all these aspects will be looked into.”

The Muslim religious event ended peacefully and the situation had returned to normal, Kumar added.

Police have yet to arrest the main suspect, who belongs to the hardline Hindu group Bajrang Dal, said Bholendra, a leader of the group, who goes by one name.

Only an investigation would reveal if members of the group were guilty, he added. “Every action has a reaction,” he said, however, while adding that the group did not believe in unprovoked violence.

Last year, a Reuters investigation here showed that cow vigilantism flourished during the first three years of the term of Prime Minister Narendra Modi's government, run by his Hindu nationalist Bharatiya Janata Party (BJP).

Bhola Singh, the BJP lawmaker from the district, told reporters the protests escalated because people were agitated over two recent incidents of cow slaughter.

The dead police officer, Subodh Kumar Singh, had helped lead an investigation into the 2015 murder by a Hindu mob of a Muslim man rumored to have slaughtered a cow in a village that is about an hour’s travel away by road from the district.

The family of the man, a blacksmith, denied the accusation that they secretly ate beef, which is banned in many Indian states including Uttar Pradesh, which is ruled by a Hindu priest from the BJP.

Police officer Kumar declined to say why Singh was transferred from the area and the murder case handed to another officer.