EXCLUSIVE: Relentless attacks on American military personnel at the height of the Iraq war made the U.S. intelligence community confront a dire problem: They needed real-time intelligence to take Al Qaeda off the battlefield and dismantle its bomb-making factories.

This realization was the start of a highly secretive program, developed by the National Security Agency, to put NSA specialists on the battlefield in order to send “near real-time” intelligence to the troops so they could avoid ambushes and root out insurgents. For the first time, going in depth with Fox News, senior NSA leadership is speaking publicly about that program, called the Real Time Regional Gateway or RT-RG.

"Starting in 2005, we started seeing a big uptick in casualties caused by IEDs [improvised explosive devices] and ambushes," NSA Deputy Director Rick Ledgett told Fox News. The RT-RG program created to combat those attacks, he said, “was really a complete change in how we provided signals intelligence support to the tactical war fighter.”

The program, parts of which were classified until now, has dispatched thousands of NSA experts into war zones since 9/11. It has put those experts – from an agency most-known for its controversial surveillance programs – at grave risk across multiple theatres. But in the process, officials say, RT-RG has saved the lives of fellow Americans.

Col. Bob Harms, one of the first people on the ground for the NSA at Baghdad's Camp Victory, said the goal was to “get in front of our adversaries.”

Exclusive images shared with Fox News from Camp Victory show the basic set-up, which took traditional streams of intelligence and married it up with information gathered from raids – for instance, taking satellite images and combining that with on-the-ground information about an insurgent’s movements and contacts, to pinpoint threats.

Some of the most useful information came from captured operatives – information known in the intel world as "pocket litter." Harms said this included “pattern of life” details including “when do they go to sleep, where do they go to sleep, where do they work and those types of things." 

The NSA's goal was to compress the timeline for crunching all this information from a period of weeks or days, to just hours or minutes. Think of it like a phone app -- but instead of giving directions, it's flagging threats.  

"[Battlefield commanders] would actually feed us information … so that we could give them a roadmap to the next site,” Harms explained.

Ledgett said the program harnessed big data, in a way that it could be used immediately on the battlefield. Ledgett said RT-RG "integrated hundreds of pieces of information," and then software was developed to draw connections that could "put things on graphical displays" so it was easy for analysts and operators to understand.

"It might connect something like a phone number to a location, to an activity and display that to an analyst who could then, via radio, contact a convoy and say, ‘Hey looks like there's an ambush waiting for you at this point -- go left or go right or take an alternate route,’" he said.

Asked about collateral damage – the accidental killing of civilians -- Ledgett said the program reduced those numbers because targeting data was drawn from multiple sources. No further specifics were offered.

Retired Gen. Jack Keane, a Fox News military analyst, said the program "gave a tool to brigade commanders, who were spread out all over the battlefield, something that they never had before."

It also took NSA experts out of the office and placed them in the field, to work side-by-side with special operations.

 

"We needed to be coffee-breath close in order to have that shared situational understanding," Harms said. 

The program extended from Iraq to Afghanistan, and then other conflict zones that the NSA will not publicly identify. The statistics, declassified for this report, are sobering.

"Since 2001, we've deployed 5,000 NSA people to Iraq and 8,000 to Afghanistan -- and in total, 18,000 to hostile areas around the world," Ledgett said. "When the operational community embraces you that way and says ‘I want you on my team and I want you there with me’ … that's a pretty significant statement of value."

The deployments came with risk. Since 9/11, 24 names have been added to the NSA’s memorial wall, which pays tribute to fallen employees. Among them is NSA technical expert Christian Pike, who was killed in Afghanistan in 2013 working with the Navy SEALs.

"I'm sorry, I get a little emotional about this one," Ledgett said, taking a pause during the interview as he described a cabinet in his office with memorial cards for James T. Davis, one of the first Americans killed in Vietnam; NSA’s Amanda Pinson, killed by an IED in Iraq while providing signals intelligence support; and Christian Pike. Pike was also a family friend.

This Saturday is Armed Forces Day – and what was a ground-breaking NSA program a decade ago is now widely used by the war fighter.

Ledgett said one of the commanding generals in Iraq during the surge credited the NSA with helping take over 4,000 insurgents off the battlefield.

“There was an intense effort here … How do we drive those losses down?” Ledgett said. "Our job was to get the information to the people who needed it."

Catherine Herridge is an award-winning Chief Intelligence correspondent for FOX News Channel (FNC) based in Washington, D.C. She covers intelligence, the Justice Department and the Department of Homeland Security. Herridge joined FNC in 1996 as a London-based correspondent.