MIDLAND, Texas -- Wounded U.S. military veterans leapt for their lives just before a freight train struck their parade in rural Texas, killing four veterans and injuring 16, and federal officials rushed to the scene Friday to piece together why it happened.

About two dozen veterans and their spouses had been sitting on the parade float, set up on a flatbed truck decorated with American flags. Many seemed to panic as the train's horn blared, said Patricia Howle, who was waiting in her car at a nearby traffic light.

"I was on the phone, and I just started screaming," she told The Associated Press after Thursday afternoon's crash. "The truck was on the other side of the train, but I did see the panic on the faces of the people and saw some of them jump off."

Police said the first truck with veterans safely crossed the tracks, but the second truck's trailer was still on the crossing as the Union Pacific locomotive approached.

The U.S. marked Veterans Day earlier this week, and the parade was part of an event to honour wounded veterans.

The scene just after the crash reminded Sudip Bose, a doctor and front-line physician in Iraq who had been volunteering at the parade, of war. He said veterans were already tending to the wounded with limited medical supplies when he arrived.

"Instincts kicked in. They were applying tourniquets, holding pressure to the wounds." Bose said.

Police on Friday confirmed that all four of the dead were veterans. Midland city police spokesman Ryan Stout said 37-year-old Sgt. Maj. Gary Stouffer and 47-year-old Sgt. Maj. Lawrence Boivin were pronounced dead at the scene and 34-year-old Army Sgt. Joshua Michael and 43- year-old Army Sgt. Maj. William Lubbers were pronounced dead at a hospital.

A preliminary investigation indicated the crossing gate and lights were working, said Union Pacific spokesman Tom Lange, though he didn't know if the train crew saw the float approaching.

"There is going to be a very thorough investigation," Lange said. "It's obviously a very tragic incident." He said the train crew did not sustain any injuries but would be offered counselling.

Six people remained hospitalized Friday, including one in critical condition. Ten others were treated and released.

"The train honked its horn, but the 18-wheeler could not go anywhere because of the other one being right in front of it. It was a horrible accident to watch happen right in front of me," said Daniel Quinonez, who was in traffic that had been stopped to allow the parade to pass. "I just saw the people on the semi-truck's trailer panic, and many started to jump off the trailer. But it was too late for many of them because the train impacted the trailer so fast."

Pam Shoemaker said she and her husband, a special ops veteran, were on the float ahead of the one that was struck. She said they heard the train coming but had heard no warning before that. They jumped from the float just as crossing barriers had just started to come down.

Her husband, Tommy, resuscitated one person and applied a tourniquet to a bleeding woman.

"They are trained for tragedy," Shoemaker said.

The event was organized by Show Of Support, a local veterans group. Its president, Terry Johnson, did not immediately return an email for comment and his phone number was unlisted. The phone rang unanswered at the group's offices.

The chairwoman of the National Transportation Safety Board, Deborah Hersman, said Friday on NBC that the train was equipped with a forward-facing camera whose footage could help in the investigation.

"That will give us some video images if it survived the crash, and we can download it, as well as recorders on the train," Hersman said. "We're going to be looking at the signals ... and making sure that the gates and lights were coming down."

Secretary of Defence Leon Panetta "was deeply saddened by news of the tragic accident involving veterans heroes and their spouses in Midland," Pentagon spokesman George Little said in a statement.

At a prayer vigil Friday morning, Mayor Wes Parry's voice cracked as he described how he had met Boivin, one of the victims, and his wife a day earlier.

"It's hard to believe today that he's not here anymore," Parry said.