Authorities are crediting a hidden camera and specialized training with ending a standoff with an Alabama man who had been holding a child captive in an underground bunker.

The FBI Hostage Rescue Team moved in on hostage-taker and suspected murderer Jimmy Lee Dykes, 65, on Monday night, killing the man and rescuing Ethan, the five-year-old boy he had been holding captive in a bunker near Midland City in southeastern Alabama.

Dykes had been holed up in the underground bunker since shooting school bus driver Charles Albert Poland Jr. to death and taking the boy.

The FBI’s Steve Richardson said authorities stormed the bunker — about five square metres of floor space about one metre underground — after Dykes was seen with a gun, leading officers to conclude the boy was in imminent danger.

Authorities were able to peer inside the bunker with a camera they managed to get into the underground structure, NPR reports. Video showed Dykes taking care of the boy and sleeping peacefully during the standoff’s first days, but later appearing agitated, sources told NPR.

It’s not clear how the camera was placed in the bunker, but authorities were able to speak directly with Dykes through a plastic pipe. The pipe also allowed officials to send items like food and the boy’s medicine into the bunker.

FBI mum on negotiation tactics

The FBI has been tight-lipped about its negotiations with Dykes, a retired trucker who served in the Navy during the Vietnam War era. Richardson said talks had been deteriorating during the 24 hours before the rescue.

"He always said he’d never be taken alive," said Roger Arnold, an acquaintance of Dykes. "I knew he’d never come out of there." 

Meanwhile, FBI agents trained for the takedown using a mock model of Dykes’ bunker, ABC News, citing unnamed sources, reported.

The FBI has not released details of their raid on the bunker, nor have they said how Dykes was killed. Neighbours described hearing what sounded like gunshots around the time authorities moved in on the compound.

Dale County Sheriff Wally Olson said Dykes was armed when officers entered the bunker to rescue the child. He said the boy was threatened but declined to elaborate.

"That's why we went inside — to save the child," Olson said.

Investigators continue to sweep Dykes’ property for explosives and other weapons on Tuesday.