Police began the operation to clear the park in Mathura, 140 km (85 miles) southeast of the capital New Delhi, on Thursday after a court ordered about 3,000 people to vacate the area.
Officials said they were investigating why the squatters had gathered in the park, and were looking into reports the group belonged to a local cult.
Land dispute: One killed, five others injured in armed clash in Landhi
The court had directed authorities to clear the land after the squatters refused to comply with earlier orders to leave.
Debashish Panda, the principal home secretary in Uttar Pradesh state, told Reuters police had initially responded to gunshots with tear gas and rubber bullets but then returned fire when the two police officers were killed.
Other officials said it was not immediately clear how the squatters died.
Minor playing cricket killed in gunfire
The chief minister of Uttar Pradesh state, where Mathura is located, has ordered an inquiry.
Around 200 members of the squatters' group were also arrested.
Uttar Pradesh police chief Javeed Ahmed told reporters at the scene on Friday the group had set fire to their tents before abandoning the camp after the clashes.
14 get death for Saudi Shia town unrest
"Subsequent searches by the police revealed that the activists of the group ... had stored firearms and other weapons, including grenades, in the camp," he said.
COMMENTS (1)
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ