The Ministry of Defence is to be censured over the deaths of three soldiers on an SAS training exercise in the Brecon Beacons in 2013.
The Health and Safety Executive said it will issue a so-called Crown Censure following the tragedy on one of the hottest days of 2013.
But for Crown immunity, the MoD would have faced prosecution for failings identified, said the HSE.
Lance Corporal Craig Roberts died during the march and Lance Corporal Edward Maher and Corporal James Dunsby collapsed and died later.
HSE head of operations Neil Craig said: "Specialist military units rightly need to test rigorously the fitness and resilience of potential candidates.
"Health and safety is not about stopping people from doing dangerous work or being properly prepared for military duties. Military training is inherently hazardous. However, such testing needs to be managed effectively.
"The MoD has a duty to manage the risks during training exercises. It failed to do so on this occasion.
"Since the incident, HSE has worked closely with the MoD to ensure it has learned lessons and how it can reduce the risk of similar tragedies occurring in future without compromising or changing the arduous nature of the essential training and testing they need to provide."
The HSE said its investigation found a failure to plan, assess, and manage risks associated with climatic illness during the training.
These failings resulted in the deaths of the three men and heat illness suffered by 10 others on the march.
Despite its Crown status, the MoD is not exempt from its responsibilities as an employer to reduce the risks to its employees as far as reasonably practicable, it added.
The breach of law the Censure is being issued over is Section 2(1) of the Health and Safety at Work Act 1974, which states: "It shall be the duty of every employer to ensure, so far as is reasonably practicable, the health, safety and welfare at work of all his employees."
The MoD cannot face prosecution in the same way as non-Government bodies and a Crown Censure is the maximum sanction for a government body that HSE can bring.
There is no financial penalty associated with Crown Censure, but once accepted is an official record of a failing to meet the standards set out in law.
It is thought that the group involved were carrying out an exercise known as the "Fan Dance".
It requires a soldier carrying a weighted pack and rifle to march up and down 2,900ft-high Pen y Fan mountain, then doing it again in reverse, in a set time.
On the day in question, July 13, temperatures hit 29.5C, and emergency crews were called to Pen y Fan after reports that six soldiers had collapsed suffering heat exhaustion.
Recording narrative verdicts at an inquest in Solihull in July 2015, senior Birmingham coroner Louise Hunt said all three soldiers would have survived if Ministry of Defence regulations on heat illness had been followed.
L/Cpl Roberts was originally from Penrhyn Bay in North Wales, L/Cpl Maher, was from Winchester in Hampshire, and Cpl Dunsby was from Trowbridge in Wiltshire.
A Ministry of Defence spokesman said: "The MoD acknowledges this censure and has apologised for the failures identified by the coroner and the Health and Safety Executive.
"We have made several improvements to reduce the risks on such exercises, and the Defence Safety Authority is conducting a service inquiry to identify any further lessons to prevent a recurrence of this tragedy.
"Our thoughts remain with the families and friends of Corporal James Dunsby, Lance Corporal Craig Roberts and Trooper Edward Maher."