Nobody likes having a bad day at work, but for fighter pilots, the extreme g-forces involved in even routine aerial manoeuvres make for a uniquely dangerous occupational hazard.

And that's perhaps never clearer than when watching this newly declassified video footage from the US Air Force, which records the frantic moments when an F-16 test pilot passed out due to G-LOC – g-force induced loss of consciousness.

Fortunately for him, the F-16's Auto-GCAS (Ground Collision Avoidance System) steps in at just the right moment, preventing what could have otherwise been a fatal accident.

As you can see in the video, when G-LOC happens, it happens pretty fast.

The pilot, a trainee whose call sign is Ocho, was flying over the US southwest as part of a training exercise on May 5 this year. His instructor, who you can hear in the audio, was flying a separate F-16 at the time.

At first, everything looks like it's going fine, with Ocho performing a basic fighter manoeuvre. But as the F-16 hits about 8.3G (in g-forces) in a turn, the pilot passes out and the jet begins to steeply nose-dive towards the desert below.

For reference, a typical person can handle about 5G, and with training, fighter pilots can take a sustained 9G. But on this day, the turn proved to be too much for the trainee, who suddenly lost consciousness without warning.

"I started to roll and started to pull and I'm following [the instructor pilot] with my eyes," Ocho said.

"The next thing I remember is just waking up and hearing 'recover'. It happened so fast. Usually, most people get tunnel vision that gradually comes in. That's what I always get, but that day I didn't get anything."

The whole drama escalates quickly. In the space of less than 20 seconds, the F-16 plummets from an altitude of around 17,000 feet (5,181 metres) to under 9,000 feet (2,743 metres).

At this point, Auto-GCAS kicks in, pulling the jet out of its nose dive with only seconds to spare. The aircraft gets as low as about 4,300 feet (1,310 metres) before the F-16 begins to rise again.

The instructor, Major Luke O'Sullivan from the Arizona Air National Guard's 152nd Fighter Squadron, can be heard yelling "Recover!" to his trainee during the nose dive, but luckily for all, the safety feature operates without a hitch.

"It's definitely a valuable system," said O'Sullivan. "It does what it's supposed to and it works."

The technology is the result of nearly 30 years of development by NASA, the Air Force, and Lockheed Martin. Auto-GCAS works by continuously comparing the trajectory of the aircraft to a terrain profile generated from onboard terrain elevation data.

The instant the system predicts the trajectory will collide with the terrain profile, it executes an automatic recovery, turning the craft upwards with a 5G pull until the coast is clear. Job done, and everybody gets to walk away.

"To date, this technology has saved four pilots' lives in training and combat. This means their families didn't lose a husband, father, son or brother," said Lt. Col. Chris Keithley, commander of the 416th Flight Test Squadron. "It's a huge win and I can't overstate how meaningful it is."