SAN DIEGO — Hundreds of elite thoroughbred racehorses sprinted away from flames Thursday as one of California’s major wildfires tore through a training center in San Diego County.

Not all made it.

There was no official count of how many animals were killed in the hazy confusion as both horses and humans evacuated, but trainers at San Luis Rey Downs estimated that at least a dozen had died, possibly far more.

Horses worth hundreds of thousands of dollars who are usually carefully walked from place to place were simply set free and encouraged to run away as flames engulfed the center near Bonsall, which is just a few miles from where the fire broke out.

Mac McBride, who was working with the center’s trainers, said it was “total pandemonium when several hundred horses were cut loose,” but he believes most of the about 450 horses stabled there survived. McBride, who works at the Del Mar racetrack, said some horses were evacuated to the nearby track where many of them compete.

“There was so much smoke, it was difficult to see,” said horse trainer Dan Durham, who got his 20 horses rounded up and was loading them into vans to be evacuated. “Some of the horses were turned loose so they could be safe. They were scattered around.”

San Luis Rey Downs is home to horses that run at nearby Del Mar and other top-flight California tracks like Santa Anita Park. Doug O’Neill, whose horses have won the Kentucky Derby and Breeders’ Cup races, is among the trainers who keep at least part of their stable there.

The sign at the front calls it “Home of Azeri,” the now-retired mare who was the 2002 US Horse of the Year who earned over $4 million in her career.

Horse trainer Scott Hansen said he knows some of the 30 horses he had at the facility were killed.

“I don’t know how many are living and how many are dead,” Hansen said. “I guess I’ll have to figure that out in the morning.” For now, he said, he was concentrating on getting his horses that survived to evacuation centers.

Another trainer, Cliff Sise, told KFMB-TV that he saw about 10 horses die, including his own filly.

“It was dark, everything was hot and she wouldn’t come out. I opened the pen and tried to get behind her and get her out, and she wouldn’t get out,” Sise said. “She burned to death that quick.”