Two other militants escaped, one of them badly wounded, after the attack in Kulgam district, south of Srinagar.
The militants had assault rifles but were taken by surprise - police found the remains of pudding they had made to eat when the bear attacked.
It is thought to be the first such incident since Muslim separatists took up arms against Indian rule in 1989.
The militants had made their hideout in a cave which was actually the bear's den, said police officer Farooq Ahmed.
The dead have been identified as Mohammad Amin alias Qaiser, and Bashir Ahmed alias Saifullah.
News of the attack emerged when their injured comrade went to a nearby village for treatment.
"Word spread in the village that Qaiser had been killed by the bear," another police officer said.
A joint party of the police and army personnel went into the forest and collected the bodies of the two militants.
Police say they also recovered two Kalashnikov assault rifles and some ammunition from the hideout.
Wildlife experts say the conflict in Kashmir has actually resulted in an increase in the population of bears and leopards.
Following the outbreak of the insurgency people had to hand in their weapons to police - which put a halt to poaching.
As a result, there has been a greater incidence of man-animal conflict, say experts.
There have been many reports of bears and leopards killing or mauling humans in different parts of the Kashmir valley in recent years.
Three years ago, residents of Mandora village near the southern town of Tral, beat a black bear to death which had strayed into the village.