The two foreigners from Lashkar-e-Taiba (LeT) outfit were killed in a gun battle with security forces in Hadoora village in the northern district of Ganderbal, police said in Srinagar.
"The operation was carried out by 5 Rashtriya Rifles, the Special Operations Group (SOG) of police and the Central Reserve Police Force," an officer said.
The security forces did not suffer any casualty in the fighting that lasted more than six hours.
The battle erupted as the security forces cordoned off Hadoora village following a tip. The terrorists then opened fire at the security forces who retaliated.
A terrorist was also killed on Tuesday on the Line of Control (LoC) in Rajouri district as the army foiled an attempt by militants to sneak in from Pakistan.
Defence Ministry spokesman Lt Col Manish Mehta said in Jammu that the incident took place in Sunderbani sector.
"Troops deployed along the LoC detected the terrorists. They engaged the infiltrating terrorists with automatic weapons. One terrorist was eliminated while the rest fled towards Pakistan," he said.
The body of the dead terrorist was recovered with a weapon.
"This action assumes significance in view of a large number of intelligence reports of likely terrorist attacks around January 26," the official said, referring to the Republic Day.
India accuses Pakistan arming and training terrorists fighting in Jammu and Kashmir.