Two Israeli soldiers were killed on Wednesday evening after an accidental shooting by another soldier who perceived them as a threat.

According to the military, the two soldiers who were killed were Major Ofek Aharon (28) and Major Itamar Elharar (26) who were both company commanders in the elite Egoz unit.

“The officers were killed after a mistaken identification led to a friendly fire incident,” the IDF said in a statement.

The pair were on patrol just after 11pm at their base, Nabi Mussa, just north of the Dead Sea. Unknown to them, another soldier on patrol was in the area. They spotted him, thinking he was suspicious and approached him.

The individual, who was also unaware of another patrol, saw them approaching and seeing their weapons saw them as a threat. He perceived he was under attack and opened fire on the duo, mortally wounding them. Despite receiving medical attention, the two soldiers died a short while later.

The military initially said that Aharon and Elharar had attempted to arrest the third officer, calling for him to halt and firing into the air, but this was later found not to have been the case. The IDF currently believes that the third officer fired first, though this is still being investigated, according to IDF Central Command chief Yehuda Fuchs.

The fatal shooting came a night after someone had broken into the Nabi Mussa base and stolen military equipment, including powerful night-vision goggles, the IDF said.

It is likely this caused both pairs to be on high alert and without knowledge that the other was on patrol, causing the accidental engagement.

Describing the deaths as “painful and unfortunate,” IDF Spokesperson Ran Kochav told the Kan radio broadcaster on Thursday morning that the military would investigate the circumstances but had yet to name an officer to lead the probe.

He said IDF Chief of Staff Aviv Kohavi was heading to the Jordan Valley base on Thursday morning to meet with the unit’s commanders in order to begin the investigation.

In addition to consoling the families of the officers who were killed, Kochav said that the military would be compassionate toward the officer who mistakenly killed them.

“We will need to embrace the officer, to take care of him, to show that we are protecting him. He, of course, did this accidentally, resulting in the deaths of his friends,” Kochav said.

Defense Minister Benny Gantz expressed his condolences to the families of the fallen officers, promising a thorough investigation.

“The IDF is in the midst of a comprehensive investigation, and we will do everything to ensure that a tragedy like this does not repeat itself,” Gantz said in a statement.

Prime Minister Naftali Bennett also consoled the families, saying their loved ones had “devoted the best years of their lives to the security of Israel and the defense of the homeland.”

“The entire people of Israel mourns their passing,” he added.

This fatal shooting of two IDF officers comes a week after two Israel Air Force pilots were killed in a helicopter crash in the sea off the coast of Haifa.