The violence comes a day before a unilateral cease-fire announced by an alliance of rebel groups, United Jehad Council, begins on Friday.
The group early this week announced a three-day halt to attacks against Indian forces in Kashmir ahead of a Muslim festival.
Indian Defense Minister A.K. Antony has ruled out any cease-fire in the Muslim-majority Kashmir where nearly a dozen rebel groups have been fighting government forces since 1989 seeking independence from Hindu-majority India or its merger with Muslim Pakistan.
Militants ambushed an army convoy, hitting the soldiers from both sides of the road in a densely forested area in Watrigam, a village 45 kilometers (28 miles) north of Srinagar, killing two soldiers, said Lt. Neha Goyal, an army spokeswoman.
Srinagar is the summer capital of India's Jammu-Kashmir state.
Separately, army soldiers and police cordoned Watrina, a village 70 kilometers (44 miles) north of Srinagar, after a tip that rebels were hiding in the village, said deputy-inspector general of police B. Srinivasan.
Militants fired on the troops, triggering a 5-hour gunbattle that killed two rebels, one of them a top commander, Srinivasan said.
Also Thursday, an army patrol killed two suspected rebels who allegedly entered Indian Kashmir from Pakistan, army spokeswoman Goyal said.
There was no independent confirmation of the army and police reports.
A cooking gas cylinder exploded, killing five soldiers and two civilians and injuring six soldiers inside a military camp in Hamray, a village 38 kilometers (24 miles) north of Srinagar on Thursday, police officer Srinivasan said.
However, a man identifying himself as Junaid-ul-Islam, spokesman for Kashmir's largest rebel group Hezb-ul-Mujahedeen, claimed responsibility for the blast in a phone call to the Kashmir News Service, a local news agency.
More than 68,000 people, mostly civilians, have been killed in the conflict in the predominantly Muslim region.
Both India and Pakistan claim all of Kashmir. They have fought three wars, two of them over control of the region, since winning independence from Britain in 1947.