Indian security forces in the Kashmir Valley shot dead two militants after an hours-long gun battle for control of a government compound in which eight policemen were also killed, the state's top police official said.
The shootout ensued after the militants stormed into the police camp in Pulwama, a town in southern Kashmir, early on Saturday, SP Vaid, the director general of Jammu and Kashmir police, told reporters in Srinagar.
A search of the camp was continuing, he said.
In a statement to local newspapers, Islamist group Jaish-e-Mohammad claimed responsibility for the attack.
It was the deadliest on a state security facility since September last year, when armed militants broke into an army camp in Uri near the Line of Control (LoC) - the de facto border with Pakistan - killing 18 army personnel.
Indian troops have killed 134 militants this year, mostly in the past two months, officials said. Last year's total was 150.
Some 79 militants are believed to have crossed the LoC into Indian Kashmir in July, according to Indian officials.
Separately, India's Border Security Force said on Saturday it killed three Pakistan Rangers in a cross-border exchange of fire.
India accuses Pakistan of training and arming militants and helping them infiltrate across the LoC that divides Kashmir.
Pakistan denies those allegations.
The South Asian neighbors have fought two of their three wars since independence in 1947 over Muslim-majority Kashmir, which they both claim in full but rule in part.