Madrid (CNN) -- A high-speed passenger train derailed as it hurtled around a curve in northwestern Spain on Wednesday, killing 77 people and injuring more than 100, officials said.

By Thursday morning, the death toll had reached 77, said María Pardo Ríos, spokeswoman for the Galicia regional supreme court. In Spain, judges are often called out to the scenes of fatalities.

Pictures of the scene showed a train car snapped in two and another car on fire. Rescue crews and fellow passengers pulled out bodies through broken windows and pried open doors as stunned survivors looked on. Police escorted bloodied passengers from the wreckage.

More than 20 injured victims remained in critical condition early Thursday, said Agustin Hernandez Fernandez of the Galicia infrastructure ministry.

State railway Renfe said the train crashed on a curve several kilometers from the train station in the city of Santiago de Compostela.

The train had 218 passengers aboard and was nearing the end of a six-hour trip from Madrid to the town of Ferrol in northwest Spain when it derailed at 8:41 p.m., the railway said.

It was unclear how fast the train was traveling when it crashed. The train was capable of going up to 250 kilometers per hour (155 mph), the chief spokesman for Renfe said.

Residents who lived near the tracks told the Voz de Galicia newspaper that they heard a thunderous bang when the train crashed. Many of them rushed to the area with blankets and bottled water for the injured, the newspaper reported.

"The train had broken in half. Some pieces were on top, some pieces were on the bottom," said Ivette Rubiera Cabrera of Florida, who caught a glimpse of the wreckage while on a family vacation in Spain and sent photos to CNN's iReport.

"It was quite shocking," she said. "We had never seen anything like that. We had just been on the train last week."

Oscar Mateos told Spain's El Pais newspaper that he saw fellow passengers thrown to the ground, then tossed from one side of the train to the other.

"Help came in five minutes, but that time became an eternity," he said. "I helped people get out with broken legs and many bruises."

Alen Perez, 16, said he had been walking nearby and saw passengers helping each other out of the train.

Emergency vehicles swarmed the scene. There were several bodies on the ground, he said.

Photos he took of the crash site showed mangled pieces of a train car and black smoke billowing out of the wreckage.

Investigators are looking at all possible causes of the crash, a senior aide to Spain's prime minister said Wednesday; their initial assessment is that it likely wasn't the result of terrorism.

Are you there and safe? Tell us what's happening

Renfe's spokesman said he did not know how many crew members were aboard the train when it crashed. Normally there would be at least five crew members on a train like that, he said.

Firefighters, police and psychologists were at the scene, the Galicia government said in a statement. In Twitter posts, officials said blood donations were needed as a result of the crash.

Spain's train infrastructure authority said it was investigating.

The crash occurred shortly before a large annual celebration was set to start in Santiago de Compostela, a popular tourist destination.

Local officials canceled festivities planned for Wednesday night and Thursday.

CNN's Al Goodman reported from Madrid. CNN's Elwyn Lopez and Catherine E. Shoichet reported from Atlanta. CNN's Nelson Quinones, Marysabel Huston-Crespo and David Valenzuela contributed to this report.