The crowd hurled stones on a security force convoy passing through Ganovpora village in Shopian district following which the Army men fired a few rounds to chase it away, police officials said, adding several people were injured in the firing.
A defence spokesman, however, said the troops opened fire when a mob tried to lynch a junior commissioned officer and snatch his service weapon.
Two of the injured, identified as Javaid Ahmad Bhat and Suhail Javid Lone, died, the police officials said.
Another youth was rushed to a hospital here in a critical condition for specialised treatment, they said.
The situation in Ganovpora and adjoining areas is tense following the killings of the youths, the officials said.
A state government spokesman said the chief minister expressed deep anguish and sorrow over the death of the two civilians and ordered an inquiry into the incident.
He said Mehbooba spoke to Defence Minister Nirmala Sitharaman, who assured the chief minister that she would impress upon the field formations that mechanisms put in place were strictly adhered to prevent such incidents.
Sitharaman told the chief minister that she would seek a detailed report in connection with the incident, he added.
The defence spokesman said, "An Army administration convoy was passing through Ganovpora when it came under unprovoked and intense stone-pelting by a group of 100-120 stone-pelters. Within no time, their number swelled to 200-250 persons."
"The crowd surrounded an isolated portion of the convoy consisting of four vehicles," he said, noting that the stone-pelters caused extensive damage to these vehicles and tried to set them on fire.
"A junior commissioned officer accompanying the convoy got hit on the head and fell unconscious. He was seriously injured. The mob tried to lynch the individual and snatch his weapon."
He said, "The violent crowd further closed in towards the vehicles and attempted to set them on fire."
The spokesman said considering the extreme gravity of the situation, the Army was constrained to open fire in self defence to prevent lynching of the JCO and burning of government vehicle by the mob.
"A total of seven Army men suffered injuries while extensive damage was caused to eleven vehicles. In the process, two civilians succumbed to the bullet injuries," he said.
The police have registered a case against the Army unit concerned in connection with the incident.
The state government spokesperson said the chief minister has directed the district administration to conduct a probe into the incident and come up with findings at the earliest.
He said Mehbooba has conveyed her sympathies to the families of the dead and the injured.
Meanwhile, the mainstream and separatists condemned the killings with the latter giving a call for a shutdown on Sunday in the Valley to register their protest.
Former chief Minister Omar Abdullah said on Twitter, 'Violence in Kabul is tragic. It s even more unfortunate when you can find words here and have none for the civilians killed in Shopian today @MehboobaMufti.'
'You need to sort out the people managing your account,' he said.
The J-K Congress also condemned the killings, saying the firing on the youths was very unfortunate.
"The loss of precious lives cannot by replaced by anything," a party spokesman said.
Image only for representation. Photograph: Danish Ismail/Reuters
'Kashmiri Muslim youth, revisit your roots'
Can Dineshwar Sharma end the violence in Kashmir?
'Kashmiri youth have become the face of violence'
'Kashmir is a battle of the mind'