The Israeli army closed its investigation into the killing of a 15-year-old Palestinian boy by Israeli soldiers from two years ago, saying it was the result of errant fire.

The Israeli military prosecutor announced Monday it decided to not pursue legal action against those involved in the incident, which also saw several Palestinians injured by the Israel Defense Forces on the Jerusalem-Modiin road (Route 443) in June 2016.

To really understand Israel and the Palestinians - subscribe to Haaretz

According to a statement by the IDF spokesperson, the investigation showed that Palestinian teenager Mahmoud Rafat Badran was killed after soldiers opened fire from a range of a few dozen meters. According to the army, the commander mistakenly thought the car was carrying Palestinians suspected of attacking Israeli vehicles with stones and firebombs that night.

The military investigation found that given the circumstances, the erroneous identification of the vehicle was "sincere and reasonable" and that the force "operated appropriately."

At the same time, the prosecutor found that there were professional failures in the soldiers' conduct during the incident, but decided they do not merit legal action due to the "complex operational environment" in which the soldiers found themselves, the statement said.

Following the incident, the platoon commander's promotion to company commander was canceled and he has since left the army.

>> Sorry, Mahmoud Rafat Badran, 15, was killed by 'mistake' | Gideon Levy <<

According to the IDF, five Palestinian youths set an ambush for Israeli vehicles on Route 443. The youths spread rocks on the road and poured some 20 liters of oil on the asphalt as well. When cars approached and noticed the stones, they slowed down and were then attacked with stones and firebombs. Two passengers in a private car were lightly wounded by stones and glass shards, as was a bus passenger, and other cars were damaged.

During the incident, a military vehicle happened to pass by. When their vehicle was also hit by stones, the officer made a U-turn and returned to the section of the road where the stone barrier had been placed.

The officer and one of the soldiers noticed Palestinian cars and shot upon one. The gunfire killed 15-year-old Badran, a resident of Beit Ur a-Tahta, and wounded four other Palestinians, apparently all of them passengers in the car.

Badran's father said his son had gone to a swimming pool in Beit Sira with cousins and another relative visiting from Qatar. The actual attackers had apparently managed to flee the area shortly before the soldiers arrived on the scene.