Holed up in a shopping complex of central Srinagar since they hurled grenades and fired shots outside the chief minister's home, the two were killed after a prolonged firefight on Saturday.
"Two militants have been killed and the firefight has stopped but the search operation continues," RS Bhullar, senior official of the Border Security Force, said.
The chief minister was not at home during the attack.
Indian Deputy Prime Minister Lal Krishna Advani said the Pakistan-based Al-Mansoorian group had claimed responsibility. But two other lesser known groups, Farzandad e-Milat and Al Nasireen, also claimed responsibility.
The latest attack, that also left two Indian security personnel dead, is part of the rising cycle of violence sweeping Kashmir.