Security officials said on Saturday one of the fighters was also killed and four soldiers wounded in the attack on a Border Security Force (BSF) camp in the town of Sopore 55km north of Srinagar, the summer capital of Jammu and Kashmir.
"A group of militants equipped with automatic weapons opened heavy fire on a BSF camp early today (Saturday)," a BSF spokesman said. "The soldiers retaliated and the exchange of fire continued for an hour."
He said the other fighters fled and the area had been cordoned off for search operations.
Indian troops meanwhile shot dead five militants in the Mendhar sector of southern Poonch district after they sneaked into Indian Kashmir from the Pakistani zone of the divided state, a defence spokesman said.
"The encounter along the Line of Control is still going on," he said, referring to the de facto border dividing Kashmir between India and Pakistan.
The incidents occurred just hours before Home Minister Shivraj Patil arrived in Srinagar for a scheduled three-day tour to assess the situation in the troubled region.
Patil is scheduled to start his tour of Jammu and Kashmir on Saturday. It is his first trip to the disputed region since the new government took power in May.
No group has so far claimed responsibility for the attack.
Many Kashmiris are opposed to
rule from Delhi
Authorities say separatist violence is waning in Kashmir this year. The decline coincides with a peace process launched by India and Pakistan in 2003 to resolve a wide range of disputes, including Kashmir.
Tens of thousands of people have died since an insurgency against Indian troop presence in Kashmir in 1989 began.
India accuses Pakistan of arming, training and sending separatists into Kashmir. Islamabad calls the Kashmir rebellion an indigenous freedom struggle.