The Shin Bet officer who died Tuesday night outside the Gaza Strip was accidentally killed by a fellow officer, head of the security service Yoram Cohen revealed in a eulogy for the fallen officer Wednesday.

The officer, 29-year-old Amir Maimoni, had been on a “necessary and complex mission,” near the coastal enclave on Tuesday night, Cohen told the family and friends present at the funeral.

“Unfortunately, there was a tragic operational development that took place last night during a mission in the field,” Cohen said.

“As a result, a fellow Shin Bet officer misidentified [Maimoni] and shot at Amir, hitting him,” he said. “All efforts to revive him were for naught.”

Cohen lamented: “So young, he had not yet even started a family.”

Army Radio reported that Maimoni was hit during an alert over a suspected infiltration from Gaza into Israel, but this report was not confirmed.

File: Yoram Cohen, head of the Shin Bet security service, attends a Knesset Foreign Affairs and Defense Committee meeting, November 18, 2014. (Miriam Alster/Flash90)

File: Yoram Cohen, head of the Shin Bet security service, attends a Knesset Foreign Affairs and Defense Committee meeting, November 18, 2014. (Miriam Alster/Flash90)

Maimoni was from Zohar, a small community in southern Israel near Kiryat Gat.

Earlier in the day, his father described Amir to Ynet news as “an angel in the form of a human, a perfect person.”

Maimoni had joined the Shin Bet two years prior, against the recommendation of his father, who wanted him to work for the Agriculture Ministry.

“I asked him to stay at the Agriculture Ministry. I said to him, ‘Why do you need to put yourself in danger?'” his father told Ynet.

“But he told me, ‘Dad, money isn’t everything in this world. I want to do something that I love.'”

Shin Bet chief Cohen noted the danger inherent in his security service’s work. “These missions are carried out every day, in every place where the Shin Bet has responsibility. They are defined by their intensity, by their great complexity, sometimes by their opacity, secrecy, with an understanding of ‘Defend, but don’t be seen,'” Cohen said.

The Shin bet chief praised Maimoni for his two years of service in the Shin Bet, saying he displayed “responsibility, gravitas, dedication and constant improvement in your professionalism.”

The investigation into the incident was ongoing, Cohen said.

“This operational mishap is being looked into and investigated meticulously through every level of the organization in order to prevent similar lapses like this in the future,” he said.

“But all this does not ease our pain over the loss of Amir,” Cohen said. “May his memory be a blessing.”