MIDLAND CITY, Ala. -- As FBI and police negotiators sought for nearly a week to coax a U.S. man into freeing a 5-year-old boy held hostage in a rural underground bunker, the captor was making plans of his own, authorities say.

He rigged the bunker with explosives and tried to reinforce it against any raid, and when agents stormed the shelter Monday, Jimmy Lee Dykes engaged in a firefight that left him dead, the FBI and officials said.

Relatives said the boy, who turns 6 on Wednesday, was back at home and appeared to be doing well. He was seized off a crowded school bus Jan. 29 after authorities say the gunman shot the driver dead and took the boy at random. Officials said there was no indication that Dykes had harmed the boy.

While the FBI has said little about how it monitored Dykes' behaviour and mood in the days leading up to the rescue, the latest revelations suggest authorities were dealing with an abductor prepared for more violence even as he allowed police to send food, medicine and toys into the bunker for the boy.

For days, officers communicated with Dykes through a plastic pipe that rose up from the bunker, which was similar to a tornado shelter and apparently had running water, heat and cable television.

An FBI statement late Tuesday said Dyke, 65, had planted an explosive device in a ventilation pipe he'd told negotiators to use to communicate with him on his property in the rural Alabama community of Midland City. The suspect also placed another explosive device inside the bunker, the FBI added.

Dykes appears to have "reinforced the bunker against any attempted entry by law enforcement," FBI special agent Jason Pack said in the statement providing significant new details about how it all ended.

When agents stormed the bunker, Dykes "engaged in a firefight," Pack said.

Officers killed Dykes, said an official in Midland City, speaking on condition of anonymity because the official wasn't authorized to discuss a pending law enforcement investigation.

The two devices were "disrupted," Pack said, but did not say whether they were detonated or disarmed.

On Monday, authorities said, Dykes had a gun and appeared increasingly agitated, and negotiations were deteriorating. The Midland City official said law enforcement agents had been observing Dykes with some sort of camera, which is how they saw that he had a gun.

Dale County Coroner Woodrow Hilboldt said Tuesday that he had not been able to confirm exactly how Dykes died because the man's body had remained in the bunker. An autopsy was to be conducted once the body was removed.

The boy, who has Asperger's syndrome and attention deficit hyperactivity disorder, was said to be acting like a normal kid after his rescue.

"We know he's OK physically, but we don't know how he is mentally," Betty Jean Ransbottom, the boy's grandmother, told The Associated Press on Tuesday.

Neighbours had described Dykes as an unstable menace who beat a dog to death and threatened to shoot trespassers while patrolling his property armed.