Two Army officers and a warrant officer "had a total disregard for the safety" of their men when they organised a live ammunition training exercise in which a 21-year-old soldier was fatally shot in the head, a court martial has heard.
Ranger Michael Maguire, of the 1st Battalion, Royal Irish Regiment, was one of several soldiers who came under machine gun fire during the exercise at the Castlemartin Training Area in Pembrokeshire in May 2012.
Nigel Lickley QC, prosecuting, told the trial at Bulford that soldiers on one range were firing directly at those on the neighbouring range, who were about 1km away and would have been visible.
Rgr Maguire, from County Cork, Ireland, was shot in the forehead and killed.
He had joined the battalion in May 2010 and had completed a tour of Afghanistan.
Captain Jonathan Price, 32, now of the 2nd Battalion, Royal Irish, is accused of the manslaughter by gross negligence of Rgr Maguire through his failure to set up and supervise a safe exercise.
The training was preparing the troops for deployment to Kenya.
Lieutenant Colonel Richard Bell, 45, and Warrant Officer Stuart Pankhurst, 40, are both accused of negligently performing a duty.
Mr Lickley continued: "All three men played their part in causing this catastrophe in different ways.
"The common sense of the situation is you do not point guns at people, you do not design, permit or allow an activity that allows machine guns to fire directly in line with your men, men that you know are there, men that you might be able to see, if not the vehicles that are with them."
Mr Lickley said Price was accused of negligence by failing to attend a recce of the range when preparing a Range Action Safety Plan (Rasp), that he placed targets too close together and he failed to "deconflict" the two exercises.
He said: "Crucially, he allowed firing to take place beyond the permitted arcs of fire."
He added: "Such was the total disregard for the safety of his men that a public beach 3km away and anyone on it was put at risk of being hit, such was the range of the weapons being used, the SA80 (assault rifle) and the general purpose machine gun (GPMG).
"It's fortunate there were not more casualties."
Mr Lickley said that Bell, the senior planning officer, was accused of failing to review or counter-sign the Rasp produced by Price and failed to supervise or support him.
He said that Pankhurst, who was supervising the exercise involving Rgr Maguire on Range 10A, was accused of failing to "express any caution or concern" despite having attended the recce and having knowledge of the extent of the adjacent shooting on Range 10B.
All three defendants deny the charges and the trial, which is expected to last about six weeks, continues.
The panel of seven senior officers trying the case are set to make a site visit to the firing range later.