IMPERIAL, Calif. — A military jet slammed into a Southern California neighbourhood dense with homes and exploded in flames, but the pilot and everyone on the ground emerged unscathed, officials said.

Moments after the pilot ejected to safety Wednesday afternoon, the Harrier jet went down in a residential area of Imperial and destroyed two homes and heavily damaged a third.

Eleven-year-old Christopher Garcia was watching TV with his father and brother when he heard a frightening boom. Outside, he said he saw a pilot in a parachute falling from the sky, and what looked like a mushroom cloud of dark smoke two blocks away.

He ran to the crash scene to find one house with a collapsed roof, the neighbouring house on fire, and a crying woman shouting, “That’s my house!” The boy and other witnesses said panicked neighbours were running in every direction.

Officials stand outside a home in which the roof is burnt off after a Marine Harrier jet crashed into the neighbourhood Wednesday, June 4, 2014, in Imperial, Calif. Debris from the jet is on the ground to the right. (AP Photo/Lenny Ignelzi)

Debris from the Harrier jet hit the roof of one of the houses, which was destroyed, Marine Lt Col John Ferguson said. The subsequent explosion and fire destroyed another house and badly damaged one more.

The pilot, the only one aboard the aircraft, landed in a nearby field. He was taken to a hospital for evaluation and released, Ferguson said.

Jose Santos had seen the jet go down and was driving to the crash scene when he saw the pilot “rolling from side to side,” but looking unhurt.

Leonardo Olmeda, 25, was racing remote-controlled cars in a street with many children playing when they saw the pilot eject and the nearby explosion.

“It was a big flash, a bunch of black smoke, like a mushroom effect,” Olmeda said.

The Harrier AV-8B had taken off from Marine Corps Air Station in Yuma, Arizona, and was almost at his destination at Naval Air Facility El Centro when he ejected and the jet crashed for reasons not immediately clear, Ferguson said.

It came down in the yard on a street lined with small homes on one side with a large park on the other in Imperial, a city of about 15,000 near the U.S.-Mexico border about 145 kilometres east of San Diego.

Residents of eight more homes had to evacuate for the investigation and cleanup but later returned, officials said.