A freight train slammed into a parade float carrying wounded veterans on Thursday, killing four people and injuring 17 others as the float tried to get through a West Texas railroad crossing on its way to an honorary banquet, authorities said.

The train was sounding its horn and people were jumping off the decorated flatbed truck before the collision around 4:40 p.m. in Midland, according to witnesses and Union Pacific spokesman Tom Lange. A preliminary investigation indicates the crossing gate and lights were working, Lange said, though he didn’t know if the train crew saw the float approaching.

Two people died at the scene, while two others died at Midland Memorial Hospital, City of Midland spokesman Ryan Stout said. Six people remained hospitalized Thursday night, including at least one in critical condition; the other 11 people injured have been treated and released, hospital officials said.

About two dozen veterans and their spouses had been sitting in chairs on the float, set up on the back of a flatbed tractor-trailer decorated with American flags and signs identifying each veteran. Many seemed to panic as the locomotive’s horn sounded, said Patricia Howle, who was waiting in her car at a nearby traffic light as the train approached.

“I was on the phone, and I just started screaming,” she told The Associated Press late Thursday night. “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.”

The float was among two flatbed tractor-trailers carrying veterans and their spouses. Police said the first truck safely crossed the railroad tracks, but the second truck’s trailer was still on the crossing as the train approached.

“The train honked its horn, but the 18-wheeler could not go anywhere because of the other one being right in front of it,” said Daniel Quinonez, who was in traffic that had been stopped by sheriff’s deputies to allow the parade to pass.

“It was a horrible accident to watch happen right in front of me. 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,” he told the AP.

Several police vehicles remained at the crash scene late Thursday night. Flood lights illuminated the wreck as investigators in reflective vests and hard hats carefully took measurements of the site, which was cordoned off by yellow police tape.

The parade had been scheduled to end at a “Hunt for Heroes” banquet honoring the veterans. The wounded service members were then going to be treated to a deer-hunting trip this weekend. The events were canceled.

The events were 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.

Stout, also the police department’s spokesman, said he had no information about the individuals who died or the driver of the truck.

Lange said Union Pacific is offering help to the community and victims’ families, as well as peer-to-peer counseling for the train crew, who did not sustain any injuries.

“There is going to be a very thorough investigation,” Lange said. “It’s obviously a very tragic incident.”

The National Transportation Safety Board also is investigating, NTSB spokesman Peter Knudson said.

Secretary of Defense 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. “His thoughts and prayers are with the families of the victims, with those injured in this incident, and with the entire community.”